-
Notifications
You must be signed in to change notification settings - Fork 13k
Description
TypeScript/src/services/completions.ts
Lines 667 to 671 in 8586c99
if (incompleteCompletionsCache && completionKind === CompletionTriggerKind.TriggerForIncompleteCompletions && previousToken && isIdentifier(previousToken)) { | |
const incompleteContinuation = continuePreviousIncompleteResponse(incompleteCompletionsCache, sourceFile, previousToken, program, host, preferences, cancellationToken); | |
if (incompleteContinuation) { | |
return incompleteContinuation; | |
} |
Here when hit a cache, will directly return the cached one, but in the
continuePreviousIncompleteResponse
function, not sync the optionalReplacementSpan
' value, so there will always return the cached optionalReplacementSpan
value.TypeScript/src/services/completions.ts
Line 995 in 8586c99
optionalReplacementSpan: getOptionalReplacementSpan(location), |
But typescript-language-server
and volar
all use this field to calculate CompletionItem's textEdit
(InsertReplaceEdit) field.
https://github.com/typescript-language-server/typescript-language-server/blob/d8b4cb698b6b74f12edb0a19e6c28b391cc0e985/src/completion.ts#L104
So, should this field also be updated here? or is typescript-language-server need calculated in other ways?
Here is the first time hit a isInComplete
, the optionalReplacementSpan
' end is {line: 100, offset: 18}
Then the following inputs hit the cache, trigger position is changed, but optionalReplacementSpan
are not updated