mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 05:20:49 -05:00
In the course of writing the "add an import" implementation, I realized that we needed to know which symbols were in scope and how they were defined. This was necessary to be able to determine how to add a new import in a way that (minimally) does not conflict with existing symbols. I'm not sure that this is fully correct (especially for symbol bindings) and it's unclear to me in which cases a definition site will be missing. But this seems to work for some of the basic cases that I tried.