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

Auto-completions do not work #559

Closed
heaths opened this issue Feb 18, 2021 · 4 comments · Fixed by #567
Closed

Auto-completions do not work #559

heaths opened this issue Feb 18, 2021 · 4 comments · Fixed by #567
Assignees
Milestone

Comments

@heaths
Copy link
Contributor

heaths commented Feb 18, 2021

Using nbgv v3.3.37+0989e8fe0c

It seems middleware for System.CommandLine like [parse] and [debug] do not work, thus breaking autocompleters in bash, PowerShel, etc.

For example,

dotnet-suggest get -e C:\Users\username\.dotnet\tools\nbgv.exe --position 5 -- nbgv
error: unknown command '[suggest:0]'
nbgv v3.3.37+0989e8fe0c
Use -h, --help, or -? for usage help. Use after a command to get more help about a particular command.

Another example:

nbgv [parse] --foo
nbgv v3.3.37+0989e8fe0c
Use -h, --help, or -? for usage help. Use after a command to get more help about a particular command.
error: unknown command '[parse]'

This should have printed the tokens, and is what dotnet-suggest seems to use to provide completions automatically. For example:

dotnet-suggest [parse] get -e foo -p bar
[ dotnet-suggest [ get [ -e <foo> ] [ -p !<bar> ] ] ]
@AArnott
Copy link
Collaborator

AArnott commented Feb 18, 2021

I saw that feature advertised recently too. I tried it on a new tool I wrote and it didn't work there either.
I don't expect it to work on nbgv because it uses a very old version of the System.CommandLine library. But the new tool I wrote used the latest one and still failed. So IMO this is a non-goal until I see it working somewhere.

@heaths
Copy link
Contributor Author

heaths commented Feb 18, 2021

It works great for me across a myriad of tools, including dotnet-suggest, dotnet-trace, dotnet-format, coverlet.console, and more. nbgv is the only one I have installed that doesn't.

Please open the bug back up and I can upgrade to a newer System.CommandLine if you want. I use it across my projects frequently.

@heaths
Copy link
Contributor Author

heaths commented Feb 18, 2021

...and if you explain how you tried it and it didn't work for you, I can probably suggest what you could try instead. For example, if modifying your PowerShell $profile per instructions, you either need to start a new PowerShell source or re-dotsource your $profile.

@heaths
Copy link
Contributor Author

heaths commented Feb 18, 2021

See below. Note, also, that for dotnet-* tools you have to use dotnet-<name> instead of dotnet name because the autocompleter is registered to the application name, which is dotnet-<name>.

PowerShell.2021-02-17.17-30-10_Trim.mp4

@AArnott AArnott reopened this Feb 18, 2021
heaths added a commit to heaths/Nerdbank.GitVersioning that referenced this issue Mar 16, 2021
@AArnott AArnott removed the wontfix label Mar 28, 2021
@AArnott AArnott added this to the v3.4 milestone Mar 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants