Assign lower completion ranking to deprecated names in auto import#23188
Merged
BurntSushi merged 4 commits intoastral-sh:mainfrom Feb 11, 2026
Merged
Assign lower completion ranking to deprecated names in auto import#23188BurntSushi merged 4 commits intoastral-sh:mainfrom
BurntSushi merged 4 commits intoastral-sh:mainfrom
Conversation
BurntSushi
requested changes
Feb 10, 2026
Member
BurntSushi
left a comment
There was a problem hiding this comment.
Nice! That was easy. This LGTM with a unit test in crates/ty_ide/src/symbols.rs. You'll probably want to add a helper method PublicTest::exports that returns a &FlatSymbols (see PublicTest::exports_for). Then you can iterate over it and check whether the symbols it contains are deprecated.
In playground this term abstractc is autocompleted to AbstractContextManager but in the ty_completion_eval this is option 3. Nevertheless I'm using that because I expect that to show up higher and this case actually breaks the test case if we don't have the deprecated functionality.
Contributor
Author
|
The name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow up to #23089 this PR assigns lower completion ranking to deprecated names in auto import suggestions.
The implementation relies on finding a decorator named
deprecatedin the source code ton consider that name deprecated.Fixes astral-sh/ty#2654 for real :)
Test Plan
Added another test case for this.
I could not find an
Here's how the behavior changed:
Before:
abstractc
After: