diff --git a/src/services/services.ts b/src/services/services.ts index 3eb5ec319ad..0fd76eff61f 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -3322,11 +3322,16 @@ namespace ts { return true; } - return contextToken.kind === SyntaxKind.GreaterThanToken && - contextToken.parent && - (contextToken.parent.kind === SyntaxKind.JsxOpeningElement || - contextToken.parent.kind === SyntaxKind.JsxSelfClosingElement || - contextToken.parent.kind === SyntaxKind.JsxClosingElement); + if (contextToken.kind === SyntaxKind.GreaterThanToken && contextToken.parent) { + if (contextToken.parent.kind === SyntaxKind.JsxOpeningElement) { + return true; + } + + if (contextToken.parent.kind === SyntaxKind.JsxClosingElement || contextToken.parent.kind === SyntaxKind.JsxSelfClosingElement) { + return contextToken.parent.parent && contextToken.parent.parent.kind === SyntaxKind.JsxElement; + } + } + return false; } function isNewIdentifierDefinitionLocation(previousToken: Node): boolean { diff --git a/tests/cases/fourslash/tsxCompletion9.ts b/tests/cases/fourslash/tsxCompletion9.ts index dbb6c46293b..12542cc6b5b 100644 --- a/tests/cases/fourslash/tsxCompletion9.ts +++ b/tests/cases/fourslash/tsxCompletion9.ts @@ -11,8 +11,14 @@ //// var x2 =
/*4*/
/*5*/ world /*6*/
; //// var x3 =
/*7*/
/*8*/world/*9*/
; //// var x4 =
/*10*/
; +////
+//// /*end*/ +//// for (var i = 1; i <= 10; i++) { goTo.marker(i + ''); verify.completionListIsEmpty(); } + +goTo.marker('end'); +verify.not.completionListIsEmpty();