Skip to content

[Tab Completion] Options should filter based on template language #4387

Open

Description

@baronfel

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.

Part of dotnet/sdk#23782

Activity

  1. added this to the .NET 7.0 milestone on Feb 14, 2022
  2. added
    triaged
    on Feb 14, 2022
  3. modified the milestones: .NET 7.0, Mar'22 on Feb 14, 2022
  4. vlada-shubina commented on Feb 21, 2022

    @vlada-shubina
    Member

    Likely this is same as #4192. I need to dive deeper to see if underlying issue is already fixed.

  5. baronfel commented on Mar 21, 2022

    @baronfel
    MemberAuthor

    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

    • 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.

  6. vlada-shubina commented on Mar 31, 2022

    @vlada-shubina
    Member

    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.

  7. removed their assignment
    on May 16, 2022
  8. added
    Priority:2
    area: CLI
    on May 18, 2023
  9. added
    triage:transfer-to-sdk
    on May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:2area: CLItriage:transfer-to-sdktriaged

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions