Removed unnecessary hack in declarationUtils.

This commit is contained in:
Eric Traut 2019-10-19 12:01:30 -07:00
parent 2dd7ec9e23
commit f2daef1c0a

View File

@ -53,21 +53,6 @@ export function getDeclarationsForNameNode(node: NameNode): Declaration[] | unde
return subtype;
});
}
} else if (node.parent && node.parent.nodeType === ParseNodeType.ModuleName) {
const namePartIndex = node.parent.nameParts.findIndex(part => part === node);
const importInfo = AnalyzerNodeInfo.getImportInfo(node.parent);
if (namePartIndex >= 0 && importInfo && namePartIndex < importInfo.resolvedPaths.length) {
if (importInfo.resolvedPaths[namePartIndex]) {
// Synthesize an alias declaration for this name part. The only
// time this case is used is for the hover provider.
const aliasDeclaration: AliasDeclaration = {
type: DeclarationType.Alias,
path: importInfo.resolvedPaths[namePartIndex],
range: getEmptyRange()
};
declarations = [aliasDeclaration];
}
}
} else {
const scopeNode = ParseTreeUtils.getScopeNodeForNode(node);
if (scopeNode) {