mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Fix case for completion on the line after a self-closing element
This commit is contained in:
parent
88bffac07f
commit
b1c8303300
@ -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 {
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user