mirror of
https://github.com/microsoft/pyright.git
synced 2024-11-13 09:34:44 +03:00
Added support for packages that define __all__
in terms of a tuple rather than a list.
This commit is contained in:
parent
b51b131351
commit
c085b91dcc
@ -67,6 +67,18 @@ export function getNamesInDunderAll(symbolTable: SymbolTable): string[] | undefi
|
||||
}
|
||||
});
|
||||
|
||||
return namesToImport;
|
||||
} else if (expr.nodeType === ParseNodeType.Tuple) {
|
||||
expr.expressions.forEach((tupleEntryNode) => {
|
||||
if (
|
||||
tupleEntryNode.nodeType === ParseNodeType.StringList &&
|
||||
tupleEntryNode.strings.length === 1 &&
|
||||
tupleEntryNode.strings[0].nodeType === ParseNodeType.String
|
||||
) {
|
||||
namesToImport.push(tupleEntryNode.strings[0].value);
|
||||
}
|
||||
});
|
||||
|
||||
return namesToImport;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user