@@ -14,11 +14,11 @@ namespace ts.Completions {
14
14
return undefined ;
15
15
}
16
16
17
- const { symbols, isMemberCompletion, isNewIdentifierLocation, location, isJsDocTagName } = completionData ;
17
+ const { symbols, isGlobalCompletion , isMemberCompletion, isNewIdentifierLocation, location, isJsDocTagName } = completionData ;
18
18
19
19
if ( isJsDocTagName ) {
20
20
// If the current position is a jsDoc tag name, only tag names should be provided for completion
21
- return { isMemberCompletion : false , isNewIdentifierLocation : false , entries : JsDoc . getAllJsDocCompletionEntries ( ) } ;
21
+ return { isGlobalCompletion : false , isMemberCompletion : false , isNewIdentifierLocation : false , entries : JsDoc . getAllJsDocCompletionEntries ( ) } ;
22
22
}
23
23
24
24
const entries : CompletionEntry [ ] = [ ] ;
@@ -56,7 +56,7 @@ namespace ts.Completions {
56
56
addRange ( entries , keywordCompletions ) ;
57
57
}
58
58
59
- return { isMemberCompletion, isNewIdentifierLocation : isNewIdentifierLocation , entries } ;
59
+ return { isGlobalCompletion , isMemberCompletion, isNewIdentifierLocation : isNewIdentifierLocation , entries } ;
60
60
61
61
function getJavaScriptCompletionEntries ( sourceFile : SourceFile , position : number , uniqueNames : Map < string > ) : CompletionEntry [ ] {
62
62
const entries : CompletionEntry [ ] = [ ] ;
@@ -190,7 +190,7 @@ namespace ts.Completions {
190
190
if ( type ) {
191
191
getCompletionEntriesFromSymbols ( type . getApparentProperties ( ) , entries , element , /*performCharacterChecks*/ false ) ;
192
192
if ( entries . length ) {
193
- return { isMemberCompletion : true , isNewIdentifierLocation : true , entries } ;
193
+ return { isGlobalCompletion : false , isMemberCompletion : true , isNewIdentifierLocation : true , entries } ;
194
194
}
195
195
}
196
196
}
@@ -209,7 +209,7 @@ namespace ts.Completions {
209
209
}
210
210
211
211
if ( entries . length ) {
212
- return { isMemberCompletion : false , isNewIdentifierLocation : true , entries } ;
212
+ return { isGlobalCompletion : false , isMemberCompletion : false , isNewIdentifierLocation : true , entries } ;
213
213
}
214
214
215
215
return undefined ;
@@ -221,7 +221,7 @@ namespace ts.Completions {
221
221
if ( type ) {
222
222
getCompletionEntriesFromSymbols ( type . getApparentProperties ( ) , entries , node , /*performCharacterChecks*/ false ) ;
223
223
if ( entries . length ) {
224
- return { isMemberCompletion : true , isNewIdentifierLocation : true , entries } ;
224
+ return { isGlobalCompletion : false , isMemberCompletion : true , isNewIdentifierLocation : true , entries } ;
225
225
}
226
226
}
227
227
return undefined ;
@@ -233,7 +233,7 @@ namespace ts.Completions {
233
233
const entries : CompletionEntry [ ] = [ ] ;
234
234
addStringLiteralCompletionsFromType ( type , entries ) ;
235
235
if ( entries . length ) {
236
- return { isMemberCompletion : false , isNewIdentifierLocation : false , entries } ;
236
+ return { isGlobalCompletion : false , isMemberCompletion : false , isNewIdentifierLocation : false , entries } ;
237
237
}
238
238
}
239
239
return undefined ;
@@ -281,6 +281,7 @@ namespace ts.Completions {
281
281
entries = getCompletionEntriesForNonRelativeModules ( literalValue , scriptDirectory , span ) ;
282
282
}
283
283
return {
284
+ isGlobalCompletion : false ,
284
285
isMemberCompletion : false ,
285
286
isNewIdentifierLocation : true ,
286
287
entries
@@ -558,6 +559,7 @@ namespace ts.Completions {
558
559
}
559
560
560
561
return {
562
+ isGlobalCompletion : false ,
561
563
isMemberCompletion : false ,
562
564
isNewIdentifierLocation : true ,
563
565
entries
@@ -812,7 +814,7 @@ namespace ts.Completions {
812
814
}
813
815
814
816
if ( isJsDocTagName ) {
815
- return { symbols : undefined , isMemberCompletion : false , isNewIdentifierLocation : false , location : undefined , isRightOfDot : false , isJsDocTagName } ;
817
+ return { symbols : undefined , isGlobalCompletion : false , isMemberCompletion : false , isNewIdentifierLocation : false , location : undefined , isRightOfDot : false , isJsDocTagName } ;
816
818
}
817
819
818
820
if ( ! insideJsDocTagExpression ) {
@@ -884,6 +886,7 @@ namespace ts.Completions {
884
886
}
885
887
886
888
const semanticStart = timestamp ( ) ;
889
+ let isGlobalCompletion = false ;
887
890
let isMemberCompletion : boolean ;
888
891
let isNewIdentifierLocation : boolean ;
889
892
let symbols : Symbol [ ] = [ ] ;
@@ -919,14 +922,16 @@ namespace ts.Completions {
919
922
if ( ! tryGetGlobalSymbols ( ) ) {
920
923
return undefined ;
921
924
}
925
+ isGlobalCompletion = true ;
922
926
}
923
927
924
928
log ( "getCompletionData: Semantic work: " + ( timestamp ( ) - semanticStart ) ) ;
925
929
926
- return { symbols, isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot : ( isRightOfDot || isRightOfOpenTag ) , isJsDocTagName } ;
930
+ return { symbols, isGlobalCompletion , isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot : ( isRightOfDot || isRightOfOpenTag ) , isJsDocTagName } ;
927
931
928
932
function getTypeScriptMemberSymbols ( ) : void {
929
933
// Right of dot member completion list
934
+ isGlobalCompletion = false ;
930
935
isMemberCompletion = true ;
931
936
isNewIdentifierLocation = false ;
932
937
0 commit comments