@@ -233,18 +233,6 @@ export class GhostInlineCompletionProvider implements vscode.InlineCompletionIte
233233 context : vscode . InlineCompletionContext ,
234234 _token : vscode . CancellationToken ,
235235 ) : Promise < vscode . InlineCompletionItem [ ] | vscode . InlineCompletionList > {
236- const { prefix, suffix } = extractPrefixSuffix ( document , position )
237-
238- const matchingText = findMatchingSuggestion ( prefix , suffix , this . suggestionsHistory )
239-
240- if ( matchingText !== null ) {
241- const item : vscode . InlineCompletionItem = {
242- insertText : matchingText ,
243- range : new vscode . Range ( position , position ) ,
244- }
245- return [ item ]
246- }
247-
248236 // Check if auto-trigger is enabled
249237 // Only proceed with LLM call if:
250238 // 1. It's a manual trigger (triggerKind === Invoke), OR
@@ -258,6 +246,27 @@ export class GhostInlineCompletionProvider implements vscode.InlineCompletionIte
258246 return [ ]
259247 }
260248
249+ return this . provideInlineCompletionItems_Internal ( document , position , context , _token )
250+ }
251+
252+ public async provideInlineCompletionItems_Internal (
253+ document : vscode . TextDocument ,
254+ position : vscode . Position ,
255+ context : vscode . InlineCompletionContext ,
256+ _token : vscode . CancellationToken ,
257+ ) : Promise < vscode . InlineCompletionItem [ ] | vscode . InlineCompletionList > {
258+ const { prefix, suffix } = extractPrefixSuffix ( document , position )
259+
260+ const matchingText = findMatchingSuggestion ( prefix , suffix , this . suggestionsHistory )
261+
262+ if ( matchingText !== null ) {
263+ const item : vscode . InlineCompletionItem = {
264+ insertText : matchingText ,
265+ range : new vscode . Range ( position , position ) ,
266+ }
267+ return [ item ]
268+ }
269+
261270 // No cached suggestion available - invoke LLM
262271 if ( this . model && this . ghostContext ) {
263272 // Show cursor animation while generating
0 commit comments