Skip to content

Commit

Permalink
Prevent finding a node twice, when there is a shadowed Module name
Browse files Browse the repository at this point in the history
  • Loading branch information
razzeee committed Oct 5, 2020
1 parent 6767854 commit 674c154
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/util/references.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,19 @@ export class References {

if (treeToCheck && treeToCheck.writeable) {
needsToBeChecked.forEach((a) => {
const importNameNode = TreeUtils.findImportNameNode(
treeToCheck.tree,
a.alias,
);
if (importNameNode) {
references.push({ node: importNameNode, uri });
switch (a.type) {
case "Module": {
const importNameNode = TreeUtils.findImportNameNode(
treeToCheck.tree,
a.alias,
);
if (importNameNode) {
references.push({ node: importNameNode, uri });
}
break;
}
default:
break;
}
});
}
Expand Down

0 comments on commit 674c154

Please sign in to comment.