mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-24 09:05:18 +00:00
Previously, completions were based on just returning every identifier
parsed in the current Python file. In this commit, we change it to
identify an expression under the cursor and then return all symbols
available to the scope containing that expression.
This is still returning too much, and also, in some cases, not enough.
Namely, it doesn't really take the specific context into account other
than scope. But this does improve on the status quo. For example:
def foo(): ...
def bar():
def fast(): ...
def foofoo(): ...
f<CURSOR>
When asking for completions here, the LSP will no longer include `fast`
as a possible completion in this context.
Ref https://github.com/astral-sh/ty/issues/86
|
||
|---|---|---|
| .. | ||
| src | ||
| ast.toml | ||
| Cargo.toml | ||
| generate.py | ||