astral-sh
ruff
BlogDocsChangelog

[ty] Improve display of completions to show actual insertion text

#21988
Comparing
ag/improve-completion-display
(
8877431
) with
main
(
4e1cf57
)
CodSpeed Performance Gauge
0%
Untouched
22
Skipped
30

Benchmarks

Skipped (30)

Passed

multithreaded[altair]
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
+2%
1.7 s1.6 s
medium[static-frame]
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
21.1 s21 s
small[tanjun]
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
2.7 s2.7 s
medium[pandas]
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
70.2 s70.1 s
large[sympy]
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
56.3 s56.2 s
ty_micro[many_enum_members]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_enum_members
CodSpeed Performance Gauge
0%
125.9 ms125.9 ms
anyio
crates/ruff_benchmark/benches/ty.rs::project::anyio::project
CodSpeed Performance Gauge
0%
1.4 s1.4 s
ty_check_file[cold]
crates/ruff_benchmark/benches/ty.rs::check_file::benchmark_cold
CodSpeed Performance Gauge
0%
135.5 ms135.5 ms
ty_micro[complex_constrained_attributes_3]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_3
CodSpeed Performance Gauge
0%
71.5 ms71.5 ms
ty_micro[many_tuple_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_tuple_implicit_instance_attributes
CodSpeed Performance Gauge
0%
68 ms68 ms
small[freqtrade]
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
8.5 s8.5 s
ty_micro[complex_constrained_attributes_2]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_2
CodSpeed Performance Gauge
0%
67.8 ms67.8 ms
ty_micro[many_tuple_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_tuple_assignments
CodSpeed Performance Gauge
0%
66.5 ms66.5 ms
hydra-zen
crates/ruff_benchmark/benches/ty.rs::project::hydra::project
CodSpeed Performance Gauge
0%
1.3 s1.3 s
ty_micro[complex_constrained_attributes_1]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_1
CodSpeed Performance Gauge
0%
67.9 ms67.9 ms
DateType
crates/ruff_benchmark/benches/ty.rs::project::datetype::project
CodSpeed Performance Gauge
0%
235.8 ms235.8 ms
attrs
crates/ruff_benchmark/benches/ty.rs::project::attrs::project
CodSpeed Performance Gauge
0%
443.6 ms443.6 ms
ty_micro[many_string_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_string_assignments
CodSpeed Performance Gauge
0%
85.5 ms85.5 ms
ty_check_file[incremental]
crates/ruff_benchmark/benches/ty.rs::check_file::benchmark_incremental
CodSpeed Performance Gauge
0%
6.7 ms6.7 ms
medium[colour-science]
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
109.2 s109.4 s
small[altair]
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
5.6 s5.6 s
large[pydantic]
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
-2%
202.4 s206.7 s

Commits

Click on a commit to change the comparison range
Base
main
4e1cf57
-0.02%
[ty] Suppress keyword argument completions unless we're in the "arguments" Otherwise, given a case like this: ``` (lambda foo: (<CURSOR> + 1))(2) ``` we'll offer _argument_ completions for `foo` at the cursor position. While we do actually want to offer completions for `foo` in this context, it is currently difficult to do so. But we definitely don't want to offer completions for `foo` as an argument to a function here. Which is what we were doing. We also add an end-to-end test here to verify that the actual label we offer in completion suggestions includes the `=` suffix. Closes https://github.com/astral-sh/ruff/pull/21970
8877431
18 hours ago
by BurntSushi
© 2025 CodSpeed Technology
Home Terms Privacy Docs