microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.51k stars 29.39k forks source link

No Pre-selection on Manual IntelliSense Trigger #223339

Open morgilad opened 3 months ago

morgilad commented 3 months ago

There are three different reasons for triggering IntelliSense:

  1. QuickSuggestion: Triggered by user input.
  2. TriggerCharacter: Triggered by specific characters (in our case, space, dot, and open parenthesis).
  3. Manual Trigger: Triggered manually after a previous selection using editor.trigger('monaco-kusto', 'editor.action.triggerSuggest', {}).

Currently, the first item is always selected when manually triggering IntelliSense (the third option). While there is an option to customize the selection behavior for the first two reasons (QuickSuggestion and TriggerCharacter), this customization is missing for the manual trigger. It would be beneficial to have no item selected initially when IntelliSense is triggered manually. This feature was implemented in the past, as noted in this GitHub issue, but was removed for some reason.

Requesting the addition of this feature to allow for no item to be selected initially when triggering IntelliSense manually.

isidorn commented 1 month ago

Assuming | is part of the completion you might be able to use 'editor.action.triggerSuggest' as suggestion command. Such triggering is considered automatic and then the selectionMode setting applies.

@morgilad so my advice is to make sure that | is part of the completion. And then use the 'editor.action.triggerSuggest' as the suggestion command. Stop manually triggering editor.action.triggerSuggest.

Please try it out and let us know how it goes. Thank you

morgilad commented 1 month ago

Could you please provide more details? Specifically, I’m a bit confused about the part where you mention: 'And then use the "editor.action.triggerSuggest" as the suggestion command. Stop manually triggering editor.action.triggerSuggest.' Are you suggesting that I should add | to the triggerCharacters?

isidorn commented 1 month ago

@morgilad no, do not add additional triggerCharacters. Just as part of your completion return the command property to be "editor.action.triggerSuggest" https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.d.ts#L5024