Elffuss BraidHub

kikocis/continue public

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.
Changeset951aa1c26a3eed1b0fa305a0ebb3d790bf82c1710bf00129cc55ef2fef1ae1a7
Authorshamanic <shamanicbeatbox@gmail.com> · 2025-06-07 04:17 +01:00
Committershamanic <shamanicbeatbox@gmail.com> · 2025-06-07 04:17 +01:00
Parents190a805117f4

Browse the files at this changeset

1 file changed

modified extensions/vscode/src/commands.ts +9 −2
@@ -624,9 +624,16 @@
624624 }
625625 }
626626 },
627- "continue.forceAutocomplete": () => {
627+ "continue.forceAutocomplete": async () => {
628628 captureCommandTelemetry("forceAutocomplete");
629- vscode.commands.executeCommand("editor.action.inlineSuggest.trigger");
629+
630+ // 1. Explicitly hide any existing suggestion. This clears VS Code's cache for the current position.
631+ await vscode.commands.executeCommand("editor.action.inlineSuggest.hide");
632+
633+ // 2. Now trigger a new one. VS Code has no cached suggestion, so it's forced to call our provider.
634+ await vscode.commands.executeCommand(
635+ "editor.action.inlineSuggest.trigger",
636+ );
630637 },
631638
632639 "continue.openTabAutocompleteConfigMenu": async () => {