ruff/crates/ruff_python_ast
Andrew Gallant 33ed502edb 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
2025-05-29 10:31:30 -04:00
..
src ty_ide: improve completions by using scopes 2025-05-29 10:31:30 -04:00
ast.toml Auto generate visit_source_order (#17180) 2025-04-17 08:59:57 -04:00
Cargo.toml Transition to salsa coarse-grained tracked structs (#15763) 2025-02-11 11:38:50 +01:00
generate.py Remove redundant type_to_visitor_function entries (#17564) 2025-04-23 09:27:00 +02:00