@@ -14,11 +14,11 @@ namespace ts.Completions {
1414 return undefined ;
1515 }
1616
17- const { symbols, isMemberCompletion, isNewIdentifierLocation, location, isJsDocTagName } = completionData ;
17+ const { symbols, isGlobalCompletion , isMemberCompletion, isNewIdentifierLocation, location, isJsDocTagName } = completionData ;
1818
1919 if ( isJsDocTagName ) {
2020 // 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 ( ) } ;
2222 }
2323
2424 const entries : CompletionEntry [ ] = [ ] ;
@@ -56,7 +56,7 @@ namespace ts.Completions {
5656 addRange ( entries , keywordCompletions ) ;
5757 }
5858
59- return { isMemberCompletion, isNewIdentifierLocation : isNewIdentifierLocation , entries } ;
59+ return { isGlobalCompletion , isMemberCompletion, isNewIdentifierLocation : isNewIdentifierLocation , entries } ;
6060
6161 function getJavaScriptCompletionEntries ( sourceFile : SourceFile , position : number , uniqueNames : Map < string > ) : CompletionEntry [ ] {
6262 const entries : CompletionEntry [ ] = [ ] ;
@@ -190,7 +190,7 @@ namespace ts.Completions {
190190 if ( type ) {
191191 getCompletionEntriesFromSymbols ( type . getApparentProperties ( ) , entries , element , /*performCharacterChecks*/ false ) ;
192192 if ( entries . length ) {
193- return { isMemberCompletion : true , isNewIdentifierLocation : true , entries } ;
193+ return { isGlobalCompletion : false , isMemberCompletion : true , isNewIdentifierLocation : true , entries } ;
194194 }
195195 }
196196 }
@@ -209,7 +209,7 @@ namespace ts.Completions {
209209 }
210210
211211 if ( entries . length ) {
212- return { isMemberCompletion : false , isNewIdentifierLocation : true , entries } ;
212+ return { isGlobalCompletion : false , isMemberCompletion : false , isNewIdentifierLocation : true , entries } ;
213213 }
214214
215215 return undefined ;
@@ -221,7 +221,7 @@ namespace ts.Completions {
221221 if ( type ) {
222222 getCompletionEntriesFromSymbols ( type . getApparentProperties ( ) , entries , node , /*performCharacterChecks*/ false ) ;
223223 if ( entries . length ) {
224- return { isMemberCompletion : true , isNewIdentifierLocation : true , entries } ;
224+ return { isGlobalCompletion : false , isMemberCompletion : true , isNewIdentifierLocation : true , entries } ;
225225 }
226226 }
227227 return undefined ;
@@ -233,7 +233,7 @@ namespace ts.Completions {
233233 const entries : CompletionEntry [ ] = [ ] ;
234234 addStringLiteralCompletionsFromType ( type , entries ) ;
235235 if ( entries . length ) {
236- return { isMemberCompletion : false , isNewIdentifierLocation : false , entries } ;
236+ return { isGlobalCompletion : false , isMemberCompletion : false , isNewIdentifierLocation : false , entries } ;
237237 }
238238 }
239239 return undefined ;
@@ -281,6 +281,7 @@ namespace ts.Completions {
281281 entries = getCompletionEntriesForNonRelativeModules ( literalValue , scriptDirectory , span ) ;
282282 }
283283 return {
284+ isGlobalCompletion : false ,
284285 isMemberCompletion : false ,
285286 isNewIdentifierLocation : true ,
286287 entries
@@ -558,6 +559,7 @@ namespace ts.Completions {
558559 }
559560
560561 return {
562+ isGlobalCompletion : false ,
561563 isMemberCompletion : false ,
562564 isNewIdentifierLocation : true ,
563565 entries
@@ -812,7 +814,7 @@ namespace ts.Completions {
812814 }
813815
814816 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 } ;
816818 }
817819
818820 if ( ! insideJsDocTagExpression ) {
@@ -884,6 +886,7 @@ namespace ts.Completions {
884886 }
885887
886888 const semanticStart = timestamp ( ) ;
889+ let isGlobalCompletion = false ;
887890 let isMemberCompletion : boolean ;
888891 let isNewIdentifierLocation : boolean ;
889892 let symbols : Symbol [ ] = [ ] ;
@@ -919,14 +922,16 @@ namespace ts.Completions {
919922 if ( ! tryGetGlobalSymbols ( ) ) {
920923 return undefined ;
921924 }
925+ isGlobalCompletion = true ;
922926 }
923927
924928 log ( "getCompletionData: Semantic work: " + ( timestamp ( ) - semanticStart ) ) ;
925929
926- return { symbols, isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot : ( isRightOfDot || isRightOfOpenTag ) , isJsDocTagName } ;
930+ return { symbols, isGlobalCompletion , isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot : ( isRightOfDot || isRightOfOpenTag ) , isJsDocTagName } ;
927931
928932 function getTypeScriptMemberSymbols ( ) : void {
929933 // Right of dot member completion list
934+ isGlobalCompletion = false ;
930935 isMemberCompletion = true ;
931936 isNewIdentifierLocation = false ;
932937
0 commit comments