mirror of https://github.com/astral-sh/ruff
* Fixes https://github.com/astral-sh/ty/issues/1011 * Also fixes the fact that we didn't handle `.x` properly *at all* in hover/goto It turns out all of our import handling completely ignored the `level` (number of relative `.`'s) in a `from ..x.y import z` statement. It was nice seeing how much my understanding of `ty` has improved -- previously this would have all been opaque to me but now it was just, completely glaring and blatant. Fixing this required refactoring all the import code to take the importing file into consideration. I ended up refactoring a bunch of code to pass around/require `SemanticModel` more, as it's the natural API for resolving this kind of import (it actually had an API for this that was just... dead code, whoops!). |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||