Fix test failures
This commit is contained in:
parent
ea558ede86
commit
c2cdce3cd6
|
@ -1379,6 +1379,7 @@ namespace ts {
|
|||
}
|
||||
|
||||
function bindJSDocTypeAlias(node: JSDocTypedefTag | JSDocCallbackTag) {
|
||||
node.tagName.parent = node;
|
||||
if (node.fullName) {
|
||||
setParentPointers(node, node.fullName);
|
||||
}
|
||||
|
|
|
@ -6772,7 +6772,7 @@ namespace ts {
|
|||
|
||||
// TODO: determine what this does before making it public.
|
||||
/* @internal */
|
||||
export function isJSDocTag(node: Node): boolean {
|
||||
export function isJSDocTag(node: Node): node is JSDocTag {
|
||||
return node.kind >= SyntaxKind.FirstJSDocTagNode && node.kind <= SyntaxKind.LastJSDocTagNode;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,8 +84,8 @@ namespace ts.codefix {
|
|||
if (importDecl) {
|
||||
changes.delete(sourceFile, importDecl);
|
||||
}
|
||||
else if (token.kind === SyntaxKind.AtToken && isJSDocTemplateTag(token.parent)) {
|
||||
changes.delete(sourceFile, token.parent);
|
||||
else if (isJSDocTemplateTag(token)) {
|
||||
changes.delete(sourceFile, token);
|
||||
}
|
||||
else if (token.kind === SyntaxKind.LessThanToken) {
|
||||
deleteTypeParameters(changes, sourceFile, token);
|
||||
|
|
|
@ -1481,7 +1481,7 @@ namespace ts {
|
|||
function shouldGetType(sourceFile: SourceFile, node: Node, position: number): boolean {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.Identifier:
|
||||
return !isLabelName(node);
|
||||
return !isLabelName(node) && !isTagName(node);
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
case SyntaxKind.QualifiedName:
|
||||
// Don't return quickInfo if inside the comment in `a/**/.b`
|
||||
|
@ -2159,7 +2159,7 @@ namespace ts {
|
|||
function initializeNameTable(sourceFile: SourceFile): void {
|
||||
const nameTable = sourceFile.nameTable = createUnderscoreEscapedMap<number>();
|
||||
sourceFile.forEachChild(function walk(node) {
|
||||
if (isIdentifier(node) && node.escapedText || isStringOrNumericLiteralLike(node) && literalIsName(node)) {
|
||||
if (isIdentifier(node) && !isTagName(node) && node.escapedText || isStringOrNumericLiteralLike(node) && literalIsName(node)) {
|
||||
const text = getEscapedTextOfIdentifierOrLiteral(node);
|
||||
nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1);
|
||||
}
|
||||
|
|
|
@ -246,6 +246,10 @@ namespace ts {
|
|||
return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node);
|
||||
}
|
||||
|
||||
export function isTagName(node: Node): boolean {
|
||||
return isJSDocTag(node.parent) && node.parent.tagName === node;
|
||||
}
|
||||
|
||||
export function isRightSideOfQualifiedName(node: Node) {
|
||||
return node.parent.kind === SyntaxKind.QualifiedName && (<QualifiedName>node.parent).right === node;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue