ruff/crates
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
..
ruff Bump 0.11.12 (#18369) 2025-05-29 09:17:12 -04:00
ruff_annotate_snippets Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_benchmark [ty] Add --config-file CLI arg (#18083) 2025-05-27 08:00:38 +02:00
ruff_cache Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_db [ty] Support ephemeral uv virtual environments (#18335) 2025-05-28 14:54:59 +00:00
ruff_dev Add a ViolationMetadata::rule method (#18234) 2025-05-28 09:27:09 -04:00
ruff_diagnostics Add a ViolationMetadata::rule method (#18234) 2025-05-28 09:27:09 -04:00
ruff_formatter Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_graph [ty] Tell the user why we inferred the Python version we inferred (#18082) 2025-05-21 11:06:27 -04:00
ruff_index Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_linter Bump 0.11.12 (#18369) 2025-05-29 09:17:12 -04:00
ruff_macros Add a ViolationMetadata::rule method (#18234) 2025-05-28 09:27:09 -04:00
ruff_notebook Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_options_metadata [ty] Document configuration schema (#17950) 2025-05-09 10:47:45 +02:00
ruff_python_ast ty_ide: improve completions by using scopes 2025-05-29 10:31:30 -04:00
ruff_python_ast_integration_tests Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_codegen Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_formatter Preserve tuple parentheses in case patterns (#18147) 2025-05-22 07:52:21 +02:00
ruff_python_index Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_literal Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_parser ruff_python_parser: add Tokens::before method 2025-05-29 10:31:30 -04:00
ruff_python_resolver Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_semantic Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_stdlib Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_trivia Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_trivia_integration_tests Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_server Add a ViolationMetadata::rule method (#18234) 2025-05-28 09:27:09 -04:00
ruff_source_file Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_text_size Add rustfmt.toml file (#18197) 2025-05-19 11:40:58 -04:00
ruff_wasm Bump 0.11.12 (#18369) 2025-05-29 09:17:12 -04:00
ruff_workspace Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ty [ty] Split Type::KnownInstance into two type variants (#18350) 2025-05-29 14:47:55 +01:00
ty_ide ty_ide: improve completions by using scopes 2025-05-29 10:31:30 -04:00
ty_project [ty] Support publishing diagnostics in the server (#18309) 2025-05-28 13:15:11 +05:30
ty_python_semantic ty_ide: improve completions by using scopes 2025-05-29 10:31:30 -04:00
ty_server [ty] Support cancellation and retry in the server (#18273) 2025-05-28 10:59:29 +02:00
ty_test [ty] Support ephemeral uv virtual environments (#18335) 2025-05-28 14:54:59 +00:00
ty_vendored [ty] Type compendium (#18263) 2025-05-23 11:41:31 +02:00
ty_wasm [ty] Gracefully handle salsa cancellations and panics in background request handlers (#18254) 2025-05-26 13:37:49 +01:00