[ty] Support extending __all__ from an imported module even when the module is not an ExprName node (#17947)

This commit is contained in:
Alex Waygood 2025-05-08 23:54:19 +01:00 committed by GitHub
parent 9b694ada82
commit f51f1f7153
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 147 additions and 31 deletions

View file

@ -387,6 +387,14 @@ impl<'db> SemanticIndex<'db> {
.copied()
}
pub(crate) fn is_standalone_expression(
&self,
expression_key: impl Into<ExpressionNodeKey>,
) -> bool {
self.expressions_by_node
.contains_key(&expression_key.into())
}
/// Returns the id of the scope that `node` creates.
/// This is different from [`definition::Definition::scope`] which
/// returns the scope in which that definition is defined in.