ruff
33ed502e - ty_ide: improve completions by using scopes

Commit
223 days ago
ty_ide: improve completions by using scopes 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
Author
Committer
Parents
Loading