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

Only return filenames when applicable in bash completion #24690

Open
erichiller opened this issue Apr 2, 2022 · 3 comments
Open

Only return filenames when applicable in bash completion #24690

erichiller opened this issue Apr 2, 2022 · 3 comments
Labels
Milestone

Comments

@erichiller
Copy link

The current completion script for bash mixes filenames in with the dotnet commands and parameters creating a hard to find mess.

It would be nice if the completion script only returned files when they were appropriate, additionally the files should be listed after the parameters to the dotnet cli.

In the interim I modified the completion script to achieve a dumb version of this and it exhibits some of the desired properties:

  • files only when valid (as best I could)
  • parameters listed before files

Essentially it only returns the files if the only things returned from dotnet complete are prefixed with / or -. My assumption being that there will never be a file parameter without some command (eg. there's never a file directly after dotnet).

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-WebSDK untriaged Request triage from a team member labels Apr 2, 2022
@baronfel
Copy link
Member

baronfel commented Apr 2, 2022

Because completions are now managed entirely by System.CommandLine, I think we have a better way to describe this: for Arguments or Options that correspond to files, we should be able to write a completion function for GetCompletions that provides CompletionItems matching what that Argument or Option expects. For example dotnet sln <sln> add needs a PROJECT_PATH to apply, so we could suggest/complete only project files in the current directory (or the directory(ies) partially provided by the user). There's some discussion of this here if you'd like to add your thoughts, but we have some SDK work to do to define and annotate our Arguments/Options better.

@vijayrkn
Copy link
Contributor

Removing the websdk tag since this is a general SDK item.

@baronfel baronfel added Area-CLI and removed untriaged Request triage from a team member Area-NetSDK labels Aug 1, 2023
@baronfel
Copy link
Member

baronfel commented Aug 1, 2023

Tagging @MiYanni just for visibility - the completions for the CLI all-up could be better, and this is one way in particular.

@baronfel baronfel added this to the Backlog milestone Aug 1, 2023
@baronfel baronfel removed their assignment Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants