Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark deprecated CompletionItem #6949

Closed
disrupted opened this issue Feb 14, 2025 · 6 comments
Closed

Mark deprecated CompletionItem #6949

disrupted opened this issue Feb 14, 2025 · 6 comments
Assignees
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@disrupted
Copy link

If you have a question about a behavior that you’re seeing in pyright, consider posting to the Pyright discussion forum.

Is your feature request related to a problem? Please describe.
Before selecting a completion candidate I'd like to know if the class/function is deprecated. For example the symbol could be shown as strikethrough in the completion list if it is marked as deprecated.

Describe the solution you’d like
The LSP specification defines CompletionItemTag.Deprecated for deprecated symbols. https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItemTag

Pyright already supports the @warnings.deprecated decorator and assigns the reportDeprecated diagnostic if it's already in the document. I think it would be helpful to provide this information already before the user picks it from the completion. As a user, I'd like to avoid the usage of deprecated symbols when writing new code.

@Viicos
Copy link

Viicos commented Feb 14, 2025

I requested the same thing here: #6149.

@disrupted
Copy link
Author

@Viicos Thank you for the hint. I did not see that issue because I was only searching for it here. (perhaps question to maintainers:) Does it have to be a Pylance-exclusive feature? I believe since Pyright also provides completions this could be implemented here.

@Viicos
Copy link

Viicos commented Feb 14, 2025

Yes it's a bit tricky to know in which repository this should be reported, when in doubt I usually report to Pylance and the issue gets transferred if necessary ;)

@disrupted
Copy link
Author

it looks like sadly your original issue (converted to a discussion) didn't get any response. let's hope it gets more activity over here. I am just gonna link to this issue in your discussion so that the progress can be tracked across both repositories

@erictraut
Copy link
Contributor

LSP functionality is maintained by the pylance team, so I'll leave it to them to consider this enhancement request.

Could someone from the pylance team please transfer this issue to pylance-release and triage / prioritize it as you see fit? Thanks!

@debonte debonte transferred this issue from microsoft/pyright Feb 14, 2025
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Feb 14, 2025
@debonte
Copy link
Contributor

debonte commented Feb 14, 2025

Resolving as a duplicate of #6179.

At the moment this isn't really on our radar. If it gets more up-votes from the community, we'll consider adding it to our backlog.

@debonte debonte closed this as completed Feb 14, 2025
@debonte debonte added duplicate This issue or pull request already exists enhancement New feature or request and removed needs repro Issue has not been reproduced yet labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants