-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
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
theia/packages/ai-core/src/common/prompt-variable-contribution.ts
Lines 87 to 93 in 135e3a6
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)