mirror of
https://github.com/microsoft/pyright.git
synced 2024-10-27 11:18:42 +03:00
Removed unnecessary hack in declarationUtils.
This commit is contained in:
parent
2dd7ec9e23
commit
f2daef1c0a
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user