Assign lower completion ranking to deprecated names in auto import (#23188)
<!--
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
Follow up to https://github.com/astral-sh/ruff/pull/23089 this PR
assigns lower completion ranking to deprecated names in auto import
suggestions.
The implementation relies on finding a decorator named `deprecated` in
the source code ton consider that name deprecated.
Fixes astral-sh/ty#2654 for real :)
<!-- What's the purpose of the change? What does it do, and why? -->
## Test Plan
Added another test case for this.
I could not find an
Here's how the behavior changed:
Before:
abstractc<CURSOR>
```
AbstractAsyncContextManager (module: contextlib)
AbstractBasicAuthHandler (module: urllib.request)
AbstractChildWatcher (module: asyncio)
AbstractContextManager (module: contextlib)
AbstractEventLoopPolicy (module: asyncio)
abstractclassmethod (module: abc)
abstractstaticmethod (module: abc)
```
After:
```
AbstractAsyncContextManager (module: contextlib)
AbstractBasicAuthHandler (module: urllib.request)
AbstractContextManager (module: contextlib) (*, 3/7)
AbstractEventLoopPolicy (module: asyncio)
AbstractChildWatcher (module: asyncio)
abstractclassmethod (module: abc)
abstractstaticmethod (module: abc)
```
<!-- How was it tested? -->