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 {

View File

@ -11,8 +11,14 @@
//// var x2 = <div> /*4*/ <div></div> /*5*/ world /*6*/</div>;
//// var x3 = <div>/*7*/<div/>/*8*/world/*9*/</div>;
//// var x4 = <div>/*10*/</div>;
//// <div/>
//// /*end*/
////
for (var i = 1; i <= 10; i++) {
goTo.marker(i + '');
verify.completionListIsEmpty();
}
goTo.marker('end');
verify.not.completionListIsEmpty();