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

Allow disable "Remove unnecessary async" quick fix #18725

Closed
tgrushka opened this issue Dec 20, 2024 · 4 comments · Fixed by #18726
Closed

Allow disable "Remove unnecessary async" quick fix #18725

tgrushka opened this issue Dec 20, 2024 · 4 comments · Fixed by #18726
Labels
A-assists A-diagnostics diagnostics / error reporting C-feature Category: feature request

Comments

@tgrushka
Copy link

Related issues: #13492, #14262

I am visually impaired and often do imports by double-hitting ctrl-, to just do the import.

Unfortunately, this "Remove unnecessary async" menu item has started showing up in my projects, and async is certainly not unnecessary on the function I'm about to write.

The unwanted side effect is that it removes async and fails to do the import, necessitating an undo and then a careful reading of the Quick Fix menu.

My I please be able to remove this feature entirely in the rust-analyzer settings?

At minimum, if my cursor is not on the async keyword itself, it should not even offer this option, especially if there's not a yellow clippy highlight on it. Then again, I'd just rather turn it off (everything just seems to be "too helpful" nowadays...).

I checked the code for this and there seems to be no check for such a preference,, or even if "unnecessary asyncs" are allowed in clippy (not that I know how to do that anyway...).

Thank you.

@tgrushka tgrushka added the C-feature Category: feature request label Dec 20, 2024
@Veykril Veykril added A-assists A-diagnostics diagnostics / error reporting labels Dec 20, 2024
@Veykril
Copy link
Member

Veykril commented Dec 20, 2024

Indeed the assist (it should be a quickfix but its actually not right now) should definitely only trigger on the async keyword. If it was a proper quickfix, that is a diagnostic then you could disable it via the settings.

@Veykril
Copy link
Member

Veykril commented Dec 20, 2024

#18726 reduces the applicability of the assist to the async token for now

@ChayimFriedman2
Copy link
Contributor

it should be a quickfix but its actually not right now

Quickfix for what diagnostic? I mean, even Clippy does not warn on an unused async.

@Veykril
Copy link
Member

Veykril commented Dec 20, 2024

Clippy not having it right now doesn't mean it never will. The phrasing of "unnecessary something" implies a lint to me hence why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-assists A-diagnostics diagnostics / error reporting C-feature Category: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants