mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 02:35:48 -05:00
@@ -1038,7 +1038,20 @@ namespace ts.Completions {
|
||||
}
|
||||
break;
|
||||
|
||||
case SyntaxKind.JsxExpression:
|
||||
// For `<div foo={true} [||] ></div>`, `parent` will be `{true}` and `previousToken` will be `}`
|
||||
if (previousToken.kind === SyntaxKind.CloseBraceToken && currentToken.kind === SyntaxKind.GreaterThanToken) {
|
||||
isJsxIdentifierExpected = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case SyntaxKind.JsxAttribute:
|
||||
// For `<div className="x" [||] ></div>`, `parent` will be JsxAttribute and `previousToken` will be its initializer
|
||||
if ((parent as JsxAttribute).initializer === previousToken &&
|
||||
previousToken.end < position) {
|
||||
isJsxIdentifierExpected = true;
|
||||
break;
|
||||
}
|
||||
switch (previousToken.kind) {
|
||||
case SyntaxKind.EqualsToken:
|
||||
isJsxInitializer = true;
|
||||
|
||||
Reference in New Issue
Block a user