From cc507687eb36be5b7fd59eac433a9a908c1ee07e Mon Sep 17 00:00:00 2001 From: shamanic Date: Sat, 7 Jun 2025 04:17:02 +0100 Subject: [PATCH] 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. --- extensions/vscode/src/commands.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts index 351c3a33c..2162b1fca 100644 --- a/extensions/vscode/src/commands.ts +++ b/extensions/vscode/src/commands.ts @@ -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 () => {