mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 07:07:09 -05:00
Fix scope of @typedef references (#16718)
* Fix scope of @typedef references * Remove unused variables
This commit is contained in:
@@ -275,6 +275,13 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function getContainerNode(node: Node): Declaration {
|
||||
if (node.kind === SyntaxKind.JSDocTypedefTag) {
|
||||
// This doesn't just apply to the node immediately under the comment, but to everything in its parent's scope.
|
||||
// node.parent = the JSDoc comment, node.parent.parent = the node having the comment.
|
||||
// Then we get parent again in the loop.
|
||||
node = node.parent.parent;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
node = node.parent;
|
||||
if (!node) {
|
||||
|
||||
Reference in New Issue
Block a user