Skip to content

terminal completion provider extension API #224505

Description

@Tyriar

Now that the terminal suggest is getting more reliable and feature complete, we should look into what a completion provider could look like in the extension API. Some examples of where this would be useful:

  • Providing completions for shells we don't support yet, like integrating fig completion specs.
  • A provider for git that added smarts beyond what we can do in pwsh. For example it could complete git clone https:// to git clone https://github.com/ and provide the user's orgs/forks when completing https://github.com/, etc.

Activity

  1. added
    feature-request
    on Aug 1, 2024
  2. added this to the Backlog milestone on Aug 1, 2024
  3. Tyriar commented on Dec 9, 2024

    @Tyriar
    ContributorAuthor

    Megan Rogge (@meganrogge) you might be tracking this one elsewhere

  4. meganrogge commented on Dec 10, 2024

    @meganrogge
    Collaborator

    I used this #226562 to track the proposal, will keep this one to track for finalization

  5. meganrogge commented on Jul 8, 2025

    @meganrogge
    Collaborator

    API sync feedback:

    • look into why cwd is optional but somehow mandatory
    • look into why env is on resource request config
    • pass in id to registerCompletionProvider vs having id on the provider
    • ensure it's clear that id needs to be unique, mention where it will show up (setting, hover w cmd +/ )
    • add comments and examples jsdoc
    • consider glob pattern vs file extensions?
  6. changed the title [-]Explore terminal completion provider extension API[/-] [+]terminal completion provider extension API[/+] on Jul 8, 2025
  7. Tyriar commented on Jul 8, 2025

    @Tyriar
    ContributorAuthor

    API sync feedback (mostly the same as above):

    • Add docs for everything, explain commandLine, cursorPosition, replacement* etc.
    • TerminalCompletionProvider.id
      • id should instead me an arg in in call to register the provider
      • Explain requirements: unique to extension, globally?
      • Do we need to prefix the ID with the extension ID internally so extensions won't step on each other?
      • Hint where id shows up for the user (providers setting, ctrl+/ debug info)
    • TerminalResourceRequestConfig.env
      • Wasn't clear to me what this does?
    • TerminalResourceRequestConfig.cwd
      • Is it mandatory or not? Comment contradicts somewhat
    • Buffer access likely won't change commandLine
    • TerminalResourceRequestConfig.fileExtensions
      • Should we use RelativePattern?
  8. 42 remaining items

  9. removed
    insiders-released
    on Nov 7, 2025
  10. meganrogge commented on Nov 12, 2025

    @meganrogge
    Collaborator

    Feedback:

    • Remove static contribution in the API.
    • Add a selector for the completion provide so we know what type of shell it supports. We can allow * if it tries to support all shells
    export function registerTerminalCompletionProvider<T extends TerminalCompletionItem>(
    	selector: TerminalSelector,
    	provider: TerminalCompletionProvider<T>,
    	...triggerCharacters: string[]
    ): Disposable;
    
    
    export interface TerminalSelector {
    	shell: string;
    }
    
    • replace terminal.integrated.suggest.providers with individual settings for the terminal suggest provider and lsp provider
    • support registering multiple providers per extension, fixing what we do here which is pass in the extenionId for both id and extensionId
      this._proxy.$registerCompletionProvider(extension.identifier.value, extension.identifier.value, ...triggerCharacters);
  11. qarlosalberto commented on Nov 13, 2025

    @qarlosalberto

    Has it been released with 1.106?

  12. gjsjohnmurray commented on Nov 13, 2025

    @gjsjohnmurray
    Contributor

    Has it been released with 1.106?

    No, it didn't get finalized this time. See #276200

  13. qarlosalberto commented on Dec 12, 2025

    @qarlosalberto

    I can´t see the API, so I assume that this feature isn´t in the new release. But the release note is a little confusing:

    Terminal Suggest is now enabled for stable users, offering inline completions and contextual hints while you type shell commands. Suggestions now group related argument values together, so option flags and their parameters stay organized in the list
    
  14. meganrogge commented on Dec 12, 2025

    @meganrogge
    Collaborator

    We haven't finalized the API, but have rolled out suggest by default in stable now.

  15. isc-bsaviano commented on Jan 8, 2026

    @isc-bsaviano

    Hi Megan Rogge (@meganrogge), is this going to be finalized in January? It got pretty close last release and I'm eager to adopt it.

  16. meganrogge commented on Jan 8, 2026

    @meganrogge
    Collaborator

    You can adopt now just by adding it to enableProposedApi. It is not on the plan for January.

  17. isc-bsaviano commented on Jan 8, 2026

    @isc-bsaviano

    Thanks for confirming. I'll follow this issue to track finalization.

  18. tnaum-ms commented on Apr 8, 2026

    @tnaum-ms

    @microsoft/documentdb-for-vscode-core-engineering is watching this too :)

  19. gjsjohnmurray commented on Aug 23, 2026

    @gjsjohnmurray
    Contributor

    You can adopt now just by adding it to enableProposedApi. It is not on the plan for January.

    Megan Rogge (@meganrogge) please don't lose sight of getting this finalized.

    enableProposedApi means our extensions cannot be published on Marketplace. It also requires either an argv.json edit or passing a a command line argument every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

apiapi-finalizationfeature-requeston-testplanterminal-suggest

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions