You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Tab Completion] Options should filter based on template language #4387
Priority:2Work that is important, but not critical for the releasearea: CLIRelated to dotnet new CLI (usually dotnet/TemplateEngine.CLI source code)triage:transfer-to-sdkIssue should be transferred to dotnet/sdktriagedThe issue was evaluated by the triage team, placed on correct area, next action defined.
Tab completion for dotnet new should take language (and other options that help determine the actual template that's being instantiated) into account - as soon as you specify -lang F# for the webapi template, for example, that should restrict tab-completion to the options available on that template.
Currently the design is to collect all of the options for each template in the template group (aka same GroupIdentity and generally same short name) into one set of completions. This is done by
making a TemplateCommand for each template in the group
parsing the context.CommandLineText with that command
getting completions at the invoked cursor position for that parse result
A potential fix could be to check the parse errors at each iteration of the templates and not return results for templates that have parse errors.
I was stuck in dotnet/command-line-api#1696 while trying implementing solution above. Parse errors occur even when the input is correct but not complete, and it doesn't allow to evaluate if input is valid for certain TemplateCommand at the moment. On the other hand, completions are returned even when input is wrong.
This needs further investigation.
Priority:2Work that is important, but not critical for the releasearea: CLIRelated to dotnet new CLI (usually dotnet/TemplateEngine.CLI source code)triage:transfer-to-sdkIssue should be transferred to dotnet/sdktriagedThe issue was evaluated by the triage team, placed on correct area, next action defined.
Activity
vlada-shubina commentedon Feb 21, 2022
Likely this is same as #4192. I need to dive deeper to see if underlying issue is already fixed.
baronfel commentedon Mar 21, 2022
Some deeper review notes:
Currently the design is to collect all of the options for each template in the template group (aka same GroupIdentity and generally same short name) into one set of completions. This is done by
A potential fix could be to check the parse errors at each iteration of the templates and not return results for templates that have parse errors.
vlada-shubina commentedon Mar 31, 2022
I was stuck in dotnet/command-line-api#1696 while trying implementing solution above. Parse errors occur even when the input is correct but not complete, and it doesn't allow to evaluate if input is valid for certain
TemplateCommandat the moment. On the other hand, completions are returned even when input is wrong.This needs further investigation.