Files
ruff/crates/ty_completion_eval/completion-evaluation-tasks.csv
Matthew Mckee e017b039df [ty] Favor in scope completions (#21194)
<!--
Thank you for contributing to Ruff/ty! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title? (Please prefix
with `[ty]` for ty pull
  requests.)
- Does this pull request include references to any relevant issues?
-->

## Summary

Resolves https://github.com/astral-sh/ty/issues/1464

We sort the completions before we add the unimported ones, meaning that
imported completions show up before unimported ones.

This is also spoken about in
https://github.com/astral-sh/ty/issues/1274, and this is probably a
duplicate of that.

@AlexWaygood mentions this
[here](https://github.com/astral-sh/ty/issues/1274#issuecomment-3345942698)
too.

## Test Plan

Add a test showing even if an unimported completion "should"
(alphabetically before) come first, we favor the imported one.
2025-11-03 09:33:05 -05:00

1009 B

1namefileindexrank
2auto-import-skips-current-modulemain.py01
3fstring-completionsmain.py01
4higher-level-symbols-preferredmain.py0
5higher-level-symbols-preferredmain.py11
6import-deprioritizes-dundermain.py01
7import-deprioritizes-sundermain.py01
8import-deprioritizes-type_check_onlymain.py01
9import-deprioritizes-type_check_onlymain.py11
10import-deprioritizes-type_check_onlymain.py21
11import-deprioritizes-type_check_onlymain.py32
12import-deprioritizes-type_check_onlymain.py43
13internal-typeshed-hiddenmain.py05
14none-completionmain.py011
15numpy-arraymain.py0
16numpy-arraymain.py11
17object-attr-instance-methodsmain.py01
18object-attr-instance-methodsmain.py11
19raise-uses-base-exceptionmain.py02
20scope-existing-over-new-importmain.py013
21scope-prioritize-closermain.py02
22scope-simple-long-identifiermain.py01
23tstring-completionsmain.py01
24ty-extensions-lower-stdlibmain.py08
25type-var-typing-over-astmain.py03
26type-var-typing-over-astmain.py1277