Skip to content

AI Variables: Simplify for variable providers to use argument completion instead of picker #15226

@planger

Description

@planger

If an AI variable provider chooses to provide a completion items rather than triggering an argument picker to let the user specify the arguments, the variable provider needs to awkwardly implement triggerArgumentPicker() calling this.commandService.executeCommand('editor.action.triggerSuggest');. See

protected async triggerArgumentPicker(): Promise<string | undefined> {
// Trigger the suggestion command to show argument completions
this.commandService.executeCommand('editor.action.triggerSuggest');
// Return undefined because we don't actually pick the argument here.
// The argument is selected and inserted by the monaco editor's completion mechanism.
return undefined;
}
.

We should make this a viable option and avoid this awkward workaround.


@planger I used the variable argument picker to trigger the argument autocompletion. However, I only trigger your suggested command there and do not actually pick an argument myself. Please have a brief look whether this solution is okay for you. Using the command property of a completion does not work that easily here because the base variable names are provided by the default completion provider that already registers said argument picker command.

Originally posted by @lucas-koehler in #15196 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    theia-aiissues related to TheiaAI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions