Skip to content

Commit e03400d

Browse files
Refactor getParent
This will allow extending getParent to fix a couple of cases were the parent node in the AST isn't the semantic parent.
1 parent 3276905 commit e03400d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/FileIndexer.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,11 @@ export class FileIndexer {
411411
}
412412
return relationships
413413
}
414+
415+
private getParent(node: ts.Node): ts.Node {
416+
return node.parent
417+
}
418+
414419
private scipSymbol(node: ts.Node): ScipSymbol {
415420
const fromCache: ScipSymbol | undefined =
416421
this.globalSymbolTable.get(node) || this.localSymbolTable.get(node)
@@ -487,7 +492,8 @@ export class FileIndexer {
487492
}
488493
}
489494

490-
const owner = this.scipSymbol(node.parent)
495+
const ownerNode = this.getParent(node)
496+
const owner = this.scipSymbol(ownerNode)
491497
if (owner.isEmpty() || owner.isLocal()) {
492498
return this.newLocalSymbol(node)
493499
}

0 commit comments

Comments
 (0)