File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -904,6 +904,7 @@ namespace ts.Completions {
904
904
}
905
905
isMemberCompletion = true ;
906
906
isNewIdentifierLocation = false ;
907
+ isGlobalCompletion = false ;
907
908
}
908
909
else if ( isStartingCloseTag ) {
909
910
const tagName = ( < JsxElement > contextToken . parent . parent ) . openingElement . tagName ;
@@ -914,6 +915,7 @@ namespace ts.Completions {
914
915
}
915
916
isMemberCompletion = true ;
916
917
isNewIdentifierLocation = false ;
918
+ isGlobalCompletion = false ;
917
919
}
918
920
else {
919
921
// For JavaScript or TypeScript, if we're not after a dot, then just try to get the
@@ -1001,6 +1003,7 @@ namespace ts.Completions {
1001
1003
if ( ( jsxContainer . kind === SyntaxKind . JsxSelfClosingElement ) || ( jsxContainer . kind === SyntaxKind . JsxOpeningElement ) ) {
1002
1004
// Cursor is inside a JSX self-closing element or opening element
1003
1005
attrsType = typeChecker . getJsxElementAttributesType ( < JsxOpeningLikeElement > jsxContainer ) ;
1006
+ isGlobalCompletion = false ;
1004
1007
1005
1008
if ( attrsType ) {
1006
1009
symbols = filterJsxAttributes ( typeChecker . getPropertiesOfType ( attrsType ) , ( < JsxOpeningLikeElement > jsxContainer ) . attributes ) ;
Original file line number Diff line number Diff line change 1
1
/// <reference path='fourslash.ts'/>
2
2
3
+ //@Filename : file.tsx
3
4
/////// <reference path="/*1*/..\services\services.ts" /> // no globals in reference paths
4
5
////import { /*2*/ } from "./file.ts"; // no globals in imports
5
6
////var test = "/*3*/"; // no globals in strings
20
21
//// /*9*/ // insert globals
21
22
//// }
22
23
/////*10*/ // insert globals
24
+ ////const y = <div /*11*/ />;
23
25
goTo . marker ( "1" ) ;
24
26
verify . completionListIsGlobal ( false ) ;
25
27
goTo . marker ( "2" ) ;
@@ -40,3 +42,5 @@ goTo.marker("9");
40
42
verify . completionListIsGlobal ( true ) ;
41
43
goTo . marker ( "10" ) ;
42
44
verify . completionListIsGlobal ( true ) ;
45
+ goTo . marker ( "11" ) ;
46
+ verify . completionListIsGlobal ( false ) ;
You can’t perform that action at this time.
0 commit comments