Skip to content
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

Test: Terminal PowerShell Intellisense #223130

Closed
3 tasks done
Tyriar opened this issue Jul 22, 2024 · 4 comments
Closed
3 tasks done

Test: Terminal PowerShell Intellisense #223130

Tyriar opened this issue Jul 22, 2024 · 4 comments

Comments

@Tyriar
Copy link
Member

Tyriar commented Jul 22, 2024

Refs: #154662, #221977, #223063, #222408, #222302, #222068

Complexity: 5

Create Issue


Setup

To make sure everything is working, try open a pwsh terminal and make sure you see this circle in the gutter, that means that shell integration is working correctly:

image

You should be able to then type any character and an intellisense popup should appear:

image

When it's shown up is driven by terminal.integrated.suggest.quickSuggestions and terminal.integrated.suggest.suggestOnTriggerCharacters, but can also be manually invoked with ctrl+space.

Diagnostics

The dev mode status bar is useful to include in issue reports where the problem is likely caused by a bad prompt understanding:

image

Also when completions are incorrect the Pty Host output trace log is useful:

image

Test

This iteration saw a lot of changes to our experimental PowerShell intellisense:

image

Please try use the terminal with the feature enabled and see where it's good, where it gets in the way and test some of the improvements mentioned below.

  • Better reliability!
  • Completions will now show exactly what will be typed, this fixes some problems with highlighting in the suggest widget
  • Polished the cd <path> experience: / or \ is added to the end of suggestions such that they request completions immediately after accepting.
  • For directory completions, / and \ are filtered the same
  • New terminal.integrated.suggest.runOnEnter setting which configures whether pressing enter will execute the command or just complete.
  • Faster start up, at the cost of requesting "global" completions when first typing
    • A consequence of this is that it's possible to get into a state where they are stale. If you hit this I'd be interested to hear what happened. To workaround it you can run the Terminal: Clear Suggest Cache command or just toggle the suggest.enabled setting.
  • File-specific completion scoring: Files are sorted by file name length ascending, then by file extension.
  • File extensions get score boosts depending on the platform. For example ps1/bat/cmd get a boost on Windows and bat/cmd get a negative boost on non-Windows.
  • Built-in git completions (terminal.integrated.suggest.builtinCompletions)
  • Built-in code and code-insiders completions (terminal.integrated.suggest.builtinCompletions)
    • ⚠️ The VS Code completions are very basic and not currently context aware, don't spend long on this part. The work in progress is being included since it's better than nothing.
@aiday-mar
Copy link
Contributor

aiday-mar commented Jul 23, 2024

I am not sure if I setup my environment correctly to test this plan item. I installed powershell on MacOS, then opened an integrated powershell in VS Code. I was typing cd, a completion appeared, and then I expected that pressing Tab would accept the completion. Pressing Tab made the completion disappear. To accept the completion, I had to use the right arrow key. This seems to contradict the terminal.integrated.suggest.runOnEnter setting description, which mentions that the Tab key can be used to accept the result. In particular I am not able to test using the Enter key or the Tab key to accept a completion. Am I testing correctly?

Screen.Recording.2024-07-23.at.10.52.38.mov

@Tyriar
Copy link
Member Author

Tyriar commented Jul 23, 2024

FYI what @aiday-mar was seeing is ghost text for history that is provided by pwsh itself, not us. So this feature is unrelated:

image

@andreamah
Copy link
Contributor

Hmm. I can't seem to get completions on linux.

Image

Image

Image

@Tyriar do you know what I could be doing wrong?

@andreamah
Copy link
Contributor

Currently blocked on this due to the problem above, which might be fixed by #223374 in the next release.

@andreamah andreamah removed their assignment Jul 23, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants