File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -856,7 +856,7 @@ namespace FourSlash {
856856 private verifyCompletionsWorker ( options : FourSlashInterface . VerifyCompletionsOptions ) : void {
857857 const actualCompletions = this . getCompletionListAtCaret ( { ...options . preferences , triggerCharacter : options . triggerCharacter } ) ! ;
858858 if ( ! actualCompletions ) {
859- if ( options . exact === undefined ) return ;
859+ if ( "exact" in options && options . exact === undefined ) return ;
860860 this . raiseError ( `No completions at position '${ this . currentCaretPosition } '.` ) ;
861861 }
862862
Original file line number Diff line number Diff line change @@ -961,8 +961,7 @@ namespace ts.Completions {
961961 break ;
962962
963963 case SyntaxKind . BinaryExpression :
964- if ( ! ( ( parent as BinaryExpression ) . left . flags & NodeFlags . ThisNodeHasError ) ) {
965- // It has a left-hand side, so we're not in an opening JSX tag.
964+ if ( ! binaryExpressionMayBeOpenTag ( parent as BinaryExpression ) ) {
966965 break ;
967966 }
968967 // falls through
@@ -2256,7 +2255,7 @@ namespace ts.Completions {
22562255 return isStringLiteralOrTemplate ( contextToken ) && position === contextToken . getStart ( sourceFile ) + 1 ;
22572256 case "<" :
22582257 // Opening JSX tag
2259- return contextToken . kind === SyntaxKind . LessThanToken && contextToken . parent . kind !== SyntaxKind . BinaryExpression ;
2258+ return contextToken . kind === SyntaxKind . LessThanToken && ( ! isBinaryExpression ( contextToken . parent ) || binaryExpressionMayBeOpenTag ( contextToken . parent ) ) ;
22602259 case "/" :
22612260 return isStringLiteralLike ( contextToken )
22622261 ? ! ! tryGetImportFromModuleSpecifier ( contextToken )
@@ -2266,6 +2265,10 @@ namespace ts.Completions {
22662265 }
22672266 }
22682267
2268+ function binaryExpressionMayBeOpenTag ( { left } : BinaryExpression ) : boolean {
2269+ return nodeIsMissing ( left ) ;
2270+ }
2271+
22692272 function isStringLiteralOrTemplate ( node : Node ) : node is StringLiteralLike | TemplateExpression | TaggedTemplateExpression {
22702273 switch ( node . kind ) {
22712274 case SyntaxKind . StringLiteral :
Original file line number Diff line number Diff line change 1313////whatever
1414
1515// @Filename : /a.tsx
16- ////declare namespace JSX {
17- //// interface Element {}
18- //// interface IntrinsicElements {
19- //// div: {};
16+ ////declare global {
17+ //// namespace JSX {
18+ //// interface Element {}
19+ //// interface IntrinsicElements {
20+ //// div: {};
21+ //// }
2022//// }
2123//// }
2224////const ctr = </*openTag*/;
You can’t perform that action at this time.
0 commit comments