Skip to content

feat: implement attribute completions for diagnostics module #19908

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

Merged

Conversation

rmehri01
Copy link
Contributor

@rmehri01 rmehri01 commented Jun 2, 2025

Implements completions for diagnostic::on_unimplemented and diagnostic::do_not_recommend. Unless I missed it, I don't think there are other attributes here that deal with qualifiers like diagnostic:: so I added somewhat naive splitting on :: and then made it so that it is stripped before being used in the label and snippet. Similarly, in complete_known_attribute_input we first need to check if the qualifier is present instead of assuming that as_single_name_ref will work.

I also noticed that must_use is currently duplicated in functions and traits since it already shows up in item 😄

asciicast

Closes #19892

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 2, 2025
@rmehri01 rmehri01 force-pushed the rmehri01/diagnostic_attribute_completions branch 3 times, most recently from 8840c3b to d49b27b Compare June 3, 2025 00:49
@rmehri01 rmehri01 force-pushed the rmehri01/diagnostic_attribute_completions branch from d49b27b to 7e8079f Compare June 3, 2025 00:56
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll do a small follow up change to this

@Veykril Veykril added this pull request to the merge queue Jun 6, 2025
Merged via the queue into rust-lang:master with commit 6acff6c Jun 6, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No completions for the #[diagnostic] namespace are provided
3 participants