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:
shamanic 2025-06-07 04:17:02 +01:00
parent 77a723cdea
commit cc507687eb

View file

@ -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 () => {