@@ -665,7 +665,7 @@ export function getCompletionsAtPosition(
665
665
const compilerOptions = program . getCompilerOptions ( ) ;
666
666
const incompleteCompletionsCache = preferences . allowIncompleteCompletions ? host . getIncompleteCompletionsCache ?.( ) : undefined ;
667
667
if ( incompleteCompletionsCache && completionKind === CompletionTriggerKind . TriggerForIncompleteCompletions && previousToken && isIdentifier ( previousToken ) ) {
668
- const incompleteContinuation = continuePreviousIncompleteResponse ( incompleteCompletionsCache , sourceFile , previousToken , program , host , preferences , cancellationToken ) ;
668
+ const incompleteContinuation = continuePreviousIncompleteResponse ( incompleteCompletionsCache , sourceFile , previousToken , program , host , preferences , cancellationToken , position ) ;
669
669
if ( incompleteContinuation ) {
670
670
return incompleteContinuation ;
671
671
}
@@ -749,10 +749,12 @@ function continuePreviousIncompleteResponse(
749
749
host : LanguageServiceHost ,
750
750
preferences : UserPreferences ,
751
751
cancellationToken : CancellationToken ,
752
+ position : number ,
752
753
) : CompletionInfo | undefined {
753
754
const previousResponse = cache . get ( ) ;
754
755
if ( ! previousResponse ) return undefined ;
755
756
757
+ const touchNode = getTouchingPropertyName ( file , position ) ;
756
758
const lowerCaseTokenText = location . text . toLowerCase ( ) ;
757
759
const exportMap = getExportInfoMap ( file , host , program , preferences , cancellationToken ) ;
758
760
const newEntries = resolvingModuleSpecifiers (
@@ -808,6 +810,7 @@ function continuePreviousIncompleteResponse(
808
810
809
811
previousResponse . entries = newEntries ;
810
812
previousResponse . flags = ( previousResponse . flags || 0 ) | CompletionInfoFlags . IsContinuation ;
813
+ previousResponse . optionalReplacementSpan = getOptionalReplacementSpan ( touchNode ) ;
811
814
return previousResponse ;
812
815
}
813
816
0 commit comments