Teach the SymbolVisitor about more statements and expressions that can define symbols (original) (raw)

The SymbolVisitor in the ty_ide crate is much less exhaustive than the ExportFinder in the ty_python_semantic crate:

Most of these are edge cases that won't usually occur in the global scope in well-written Python code. But some of them (e.g. the type X = int case) are reasonable things that could well occur in well-written code. And the most important thing here, in my opinion, is for the two crates to have a consistent understanding of which symbols will be potentially imported by a * import. Currently ty_python_semantic does a much more rigorous job here at attempting to emulate the runtime semantics.

Cc. @BurntSushi