mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-24 11:43:18 -05:00
Visit children of jsdoc type aliases in the binder (#45312)
* Visit children of jsdoc type aliases in the binder This sets up parent pointers. Fixes #45254 and almost certainly #45248, though I haven't figured out to repro the second case. * move incorrect parenthesis * manually set comment parent instead * Bind children of typedef where possible * add explanatory comment to binding
This commit is contained in:
committed by
GitHub
parent
1cbb0bd4d3
commit
f1ce0f5528
@@ -1666,11 +1666,15 @@ namespace ts {
|
||||
}
|
||||
|
||||
function bindJSDocTypeAlias(node: JSDocTypedefTag | JSDocCallbackTag | JSDocEnumTag) {
|
||||
setParent(node.tagName, node);
|
||||
bind(node.tagName);
|
||||
if (node.kind !== SyntaxKind.JSDocEnumTag && node.fullName) {
|
||||
// don't bind the type name yet; that's delayed until delayedBindJSDocTypedefTag
|
||||
setParent(node.fullName, node);
|
||||
setParentRecursive(node.fullName, /*incremental*/ false);
|
||||
}
|
||||
if (typeof node.comment !== "string") {
|
||||
bindEach(node.comment);
|
||||
}
|
||||
}
|
||||
|
||||
function bindJSDocClassTag(node: JSDocClassTag) {
|
||||
|
||||
@@ -530,8 +530,8 @@ namespace ts {
|
||||
visitNode(cbNode, (node as JSDocTypedefTag).fullName) ||
|
||||
(typeof (node as JSDoc).comment === "string" ? undefined : visitNodes(cbNode, cbNodes, (node as JSDoc).comment as NodeArray<JSDocComment> | undefined))
|
||||
: visitNode(cbNode, (node as JSDocTypedefTag).fullName) ||
|
||||
visitNode(cbNode, (node as JSDocTypedefTag).typeExpression)) ||
|
||||
(typeof (node as JSDoc).comment === "string" ? undefined : visitNodes(cbNode, cbNodes, (node as JSDoc).comment as NodeArray<JSDocComment> | undefined));
|
||||
visitNode(cbNode, (node as JSDocTypedefTag).typeExpression) ||
|
||||
(typeof (node as JSDoc).comment === "string" ? undefined : visitNodes(cbNode, cbNodes, (node as JSDoc).comment as NodeArray<JSDocComment> | undefined)));
|
||||
case SyntaxKind.JSDocCallbackTag:
|
||||
return visitNode(cbNode, (node as JSDocTag).tagName) ||
|
||||
visitNode(cbNode, (node as JSDocCallbackTag).fullName) ||
|
||||
|
||||
Reference in New Issue
Block a user