microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.08k stars 29.24k forks source link

intellisense doesn't include the completion I want #211996

Closed amunger closed 4 months ago

amunger commented 6 months ago

Steps to Reproduce:

  1. type git checkout -- . and press enter :bug: intellisense completion was added for the argument instead of running the command

I have a pretty strong muscle memory to run that command, so now I need to remember to press escape before pressing enter

image

amunger commented 6 months ago

this is bad enough that I've turned the feature off, I can't even use git status

Tyriar commented 5 months ago

I also hit these issues particularly with git:

image image

amunger commented 5 months ago

one change that would make this much less painful: ctrl+z should undo the auto-complete change as a single action (as is the case with the text editor). I press enter really quickly, after typing what I want, and if auto-complete provides something I didn't want, ctrl+z will undo one character at a time.

Tyriar commented 5 months ago

Well powershell does support ctrl+z itself. We may be able to undo everything, or nearly everything by using bracketed paste mode, since you can paste something and undo it fine. https://github.com/microsoft/vscode/issues/213937

Tyriar commented 4 months ago

Just tried with Posh-Git and while the commands (checkout) and aliases (co in mine) work, it still doesn't suggest . after checkout:

Screenshot 2024-06-14 at 9 56 45 AM
Tyriar commented 4 months ago

(TabExpansion2 -inputScript "git co " -cursorColumn 7).CompletionMatches doesn't show files/folders so we couldn't use that. Maybe using the current completion call, but also providing ., .., etc. when there are only ProviderContainer and ProviderItem entries?

~/dev/Tyriar/xterm.js [tyriar/vscode_213174 ≡]> (TabExpansion2 -inputScript "git co ." -cursorColumn 8).CompletionMatches

CompletionText           ListItemText                  ResultType ToolTip
--------------           ------------                  ---------- -------
./.devcontainer          .devcontainer          ProviderContainer /Users/tyriar/dev/Tyriar/xterm.js/.devcontainer
./.editorconfig          .editorconfig               ProviderItem /Users/tyriar/dev/Tyriar/xterm.js/.editorconfig
./.eslintrc.json         .eslintrc.json              ProviderItem /Users/tyriar/dev/Tyriar/xterm.js/.eslintrc.json
./.eslintrc.json.typings .eslintrc.json.typings      ProviderItem /Users/tyriar/dev/Tyriar/xterm.js/.eslintrc.json.typings
./.git                   .git                   ProviderContainer /Users/tyriar/dev/Tyriar/xterm.js/.git
./.gitattributes         .gitattributes              ProviderItem /Users/tyriar/dev/Tyriar/xterm.js/.gitattributes
./.github                .github                ProviderContainer /Users/tyriar/dev/Tyriar/xterm.js/.github
./.gitignore             .gitignore                  ProviderItem /Users/tyriar/dev/Tyriar/xterm.js/.gitignore
./.gitmodules            .gitmodules                 ProviderItem /Users/tyriar/dev/Tyriar/xterm.js/.gitmodules
./.mailmap               .mailmap                    ProviderItem /Users/tyriar/dev/Tyriar/xterm.js/.mailmap
./.mocha.env             .mocha.env                  ProviderItem /Users/tyriar/dev/Tyriar/xterm.js/.mocha.env
./.mocharc.yml           .mocharc.yml                ProviderItem /Users/tyriar/dev/Tyriar/xterm.js/.mocharc.yml
./.npmignore             .npmignore                  ProviderItem /Users/tyriar/dev/Tyriar/xterm.js/.npmignore
./.npmrc                 .npmrc                      ProviderItem /Users/tyriar/dev/Tyriar/xterm.js/.npmrc
./.nvmrc                 .nvmrc                      ProviderItem /Users/tyriar/dev/Tyriar/xterm.js/.nvmrc
./.vscode                .vscode                ProviderContainer /Users/tyriar/dev/Tyriar/xterm.js/.vscode
Tyriar commented 4 months ago

Looks promising 👀

Screenshot 2024-06-14 at 10 11 11 AM