Skip to content

In VSCode tab-completion doesn't fix the casing as it does in PowerShell ISE #1624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
alexandair opened this issue Dec 1, 2018 · 11 comments
Labels
Area-UI Issue-Enhancement A feature request (enhancement).

Comments

@alexandair
Copy link

There is one thing that I used to use a lot in ISE, and is missing in PowerShell extension. In ISE, if I type "get-date" (all lower case) and then later position a cursor inside of it and press "TAB", it tab-completes to a proper casing. In VSCode, the "TAB" in that case add a tab. Could you bring back the ISE behavior?

@dsolodow
Copy link
Contributor

dsolodow commented Dec 1, 2018

It's a configurable setting in VSCode; just off by default.
"Editor: Tab Completion" needs to be set to On under Preferences

{
    "editor.tabCompletion": "on"
}

@alexandair
Copy link
Author

@dsolodow That settings doesn't work for me.
If you type "get-date" and a space, and then return and put cursor in "get-date", after you press "TAB" does it change it to "Get-Date"?

@rjmholt
Copy link
Contributor

rjmholt commented Dec 2, 2018

@alexandair If you trigger a completion in another way, does get-date have its casing changed? If so, then the remaining work lies with VSCode's completion experience. The enhancement in that case would lie within VSCode, since we don't have any way to change that experience.

@alexandair
Copy link
Author

@rjmholt
What would be another way?

Here is one more example when tab-completion is lacking in VSCode editor:
In Windows PowerShell console, PowerShell ISE, PowerShell Core console, and Integrated PowerShell Console, the following works, but not in the VSCode editor:

TAB after Get-Service -Name gives you a list of services.

@SeeminglyScience
Copy link
Collaborator

@alexandair CTRL + SPACE forces a completion request. I think VSCode would need to add an option that makes TAB only indent if all the characters to the left of the cursor are whitespace. That would give a similar experience.

@rjmholt rjmholt added Issue-Enhancement A feature request (enhancement). Area-UI labels Dec 2, 2018
@alexandair
Copy link
Author

@SeeminglyScience
For me, tab-completion involves pressing the TAB key. CTRL+SPACE triggers the IntelliSense and completion could be performed with the arrows and ENTER key.

Now, that you've mentioned CTRL+SPACE, here is another example where PowerShell ISE behaves better and consistently compared to VSCode.

Get-CimClass -Namespace

PowerShell ISE:
In both, Script and Console pane, TAB circles through the list of namespaces and CTRL+SPACE triggers IntelliSense.

VSCode:
In Editor only CTRL+SPACE works, but not TAB.
In terminal only TAB works, CTRL+SPACE is ignored.

@rjmholt
Copy link
Contributor

rjmholt commented Dec 2, 2018

See also #25.

The completion features for the terminal will be added by #535.

For the remaining Tab-completion desire, you should open a new feature request with VSCode. It's worth noting that the current "tabCompletion": "on" setting is totally orthogonal to us even though many PowerShell extension users see it as an ISE parity feature -- it just configures VSCode and we are completely agnostic as to its setting.

@alexandair
Copy link
Author

@rjmholt
I looked at #25. My latest example is after I set "tabCompletion": "on". I don't see that setting changed anything for me. If I file the original casing issue to the VSCode repo, I have a feeling they will immediately say "Oh, that's PowerShell extension issue". :)

@TylerLeonhardt
Copy link
Member

@alexandair RE: "tabCompletion":"on" I noticed that when you hit TAB, it completes with the first completion... but then AFTER that you can continue to hit TAB to cycle.

I thought it would cycle through the intellisense pop-up but it has a different behavior.

@rkeithhill
Copy link
Contributor

they will immediately say "Oh, that's PowerShell extension issue"

I dunno @alexandair. When I try this while monitoring the log file I do not see any textDocument/completion from VSCode. If they don't send us the request, I'm not sure there is much we can do about it by then other than to monkey around with document change notification we get. We already have a command that can expand all aliases in a document. How about we add a command to "properly" cases all commands and their parameters in the document/.

@TylerLeonhardt
Copy link
Member

Current "tabCompletion":"on" behavior for reference.
Imgur

How about we add a command to "properly" cases all commands and their parameters in the document/.

This makes the most sense. That way we don't have to re-implement completions for our specific use-cases. It still would be good to have an issue on VSCode to give more power over completions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-UI Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

6 participants