Fix case for completion on the line after a self-closing element

This commit is contained in:
Ryan Cavanaugh
2015-10-08 14:55:11 -07:00
parent 88bffac07f
commit b1c8303300
2 changed files with 16 additions and 5 deletions

View File

@@ -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 {