fix(vscode): improve forceAutocomplete command reliability
Modified the `forceAutocomplete` command to first hide any existing inline suggestion before triggering a new one. This ensures VS Code's suggestion cache is cleared, forcing it to call the provider for a fresh suggestion.
This commit is contained in:
parent
77a723cdea
commit
cc507687eb
1 changed files with 9 additions and 2 deletions
|
|
@ -624,9 +624,16 @@ const getCommandsMap: (
|
|||
}
|
||||
}
|
||||
},
|
||||
"continue.forceAutocomplete": () => {
|
||||
"continue.forceAutocomplete": async () => {
|
||||
captureCommandTelemetry("forceAutocomplete");
|
||||
vscode.commands.executeCommand("editor.action.inlineSuggest.trigger");
|
||||
|
||||
// 1. Explicitly hide any existing suggestion. This clears VS Code's cache for the current position.
|
||||
await vscode.commands.executeCommand("editor.action.inlineSuggest.hide");
|
||||
|
||||
// 2. Now trigger a new one. VS Code has no cached suggestion, so it's forced to call our provider.
|
||||
await vscode.commands.executeCommand(
|
||||
"editor.action.inlineSuggest.trigger",
|
||||
);
|
||||
},
|
||||
|
||||
"continue.openTabAutocompleteConfigMenu": async () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue