Skip to content

"disable warning" gets ordered high in the fix list #3238

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

Closed
lf- opened this issue Oct 3, 2022 · 4 comments
Closed

"disable warning" gets ordered high in the fix list #3238

lf- opened this issue Oct 3, 2022 · 4 comments
Labels
level: easy The issue is suited for beginners type: enhancement New feature or request

Comments

@lf-
Copy link
Contributor

lf- commented Oct 3, 2022

Is your enhancement request related to a problem? Please describe.

When I hit the code action button on unused imports, the "Disable [x] warnings" option is very high up, despite rarely being the right code action to fix the problem at hand. More generally it seems that the disable warning action is always high up on every warning.

image

Describe the solution you'd like

I would like the most appropriate fix to be first, so I can hit the "fix-first-suggestion" button in my editor to fix my imports. For instance, in this case, the first action should be deleting the unused imports on the current line.

Describe alternatives you've considered

Additional context

Reproduced on 1.7.0.0 but I'm 90% sure it's also a problem on 1.8.0.0.

@lf- lf- added status: needs triage type: enhancement New feature or request labels Oct 3, 2022
@michaelpj
Copy link
Collaborator

I think in this situation removing the specific redundant import is probably the canonical fix here, and we could just mark it as isPreferred. @andys8 you've shown this kind of problem some love before, want to take a look?

@michaelpj michaelpj added level: easy The issue is suited for beginners and removed status: needs triage labels Oct 5, 2022
@andys8
Copy link
Collaborator

andys8 commented Oct 5, 2022

Hey there, the question is if this was addressed with #3167. The PR was merged after 1.8.0.0 was released. It makes sure 3 types of "remove import" code actions will get preferred. My guess is that chances are high this specific issue is fixed, but not released yet.

@lf-
Copy link
Contributor Author

lf- commented Oct 5, 2022

Oh damn, I'll file a pr to update the work version of hls then. Thanks!

@michaelpj
Copy link
Collaborator

Oh yes, for some reason I thought it was a different code action you fixed! Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level: easy The issue is suited for beginners type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants