File tree Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -2899,7 +2899,8 @@ function getCompletionData(
28992899 // First case is for `<div foo={true} [||] />` or `<div foo={true} [||] ></div>`,
29002900 // `parent` will be `{true}` and `previousToken` will be `}`
29012901 // Second case is for `<div foo={true} t[||] ></div>`
2902- if ( previousToken . kind === SyntaxKind . CloseBraceToken || ( previousToken . kind === SyntaxKind . Identifier || previousToken . parent . kind === SyntaxKind . JsxAttribute ) ) {
2902+ // Second case must not match for `<div foo={undefine[||]}></div>`
2903+ if ( previousToken . kind === SyntaxKind . CloseBraceToken || ( previousToken . kind === SyntaxKind . Identifier && previousToken . parent . kind === SyntaxKind . JsxAttribute ) ) {
29032904 isJsxIdentifierExpected = true ;
29042905 }
29052906 break ;
Original file line number Diff line number Diff line change @@ -190,4 +190,4 @@ import "./unittests/tsserver/typingsInstaller";
190190import "./unittests/tsserver/versionCache" ;
191191import "./unittests/tsserver/watchEnvironment" ;
192192import "./unittests/debugDeprecation" ;
193- import "./unittests/tsserver/inconsistentErrorInEditor" ;
193+ import "./unittests/tsserver/inconsistentErrorInEditor" ;
Original file line number Diff line number Diff line change 1+ /// <reference path="fourslash.ts" />
2+
3+ // @Filename : /a.tsx
4+ // @jsx : react
5+ //// declare namespace JSX {
6+ //// interface IntrinsicElements {
7+ //// div: { a: string, b: string }
8+ //// }
9+ //// }
10+ //// const value = "test";
11+ //// <div a={v/**/} />
12+
13+ verify . completions (
14+ {
15+ marker : "" ,
16+ isNewIdentifierLocation : false ,
17+ preferences : {
18+ includeCompletionsWithSnippetText : true ,
19+ includeCompletionsWithInsertText : true ,
20+ jsxAttributeCompletionStyle : "auto" ,
21+ } ,
22+ includes : {
23+ name : "value" ,
24+ kind : "const" ,
25+ kindModifiers : "" ,
26+ sortText : completion . SortText . LocationPriority ,
27+ insertText : undefined ,
28+ } ,
29+ } ,
30+ ) ;
You can’t perform that action at this time.
0 commit comments