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

Changing default severity #537

Open
rudolfvesely opened this issue Jun 29, 2024 · 2 comments
Open

Changing default severity #537

rudolfvesely opened this issue Jun 29, 2024 · 2 comments
Labels
enhancement New feature or request idea-approved Proposed idea is approved by at least 1 maintainers

Comments

@rudolfvesely
Copy link

Thank you for very much @inclyc for this fantastic project!

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

Recently I noticed issue 525 since I had a similar problem. My Nix code shows a lot of sema-def-not-used which sometimes is an issue and sometimes it is deliberate:

map ({this, should, be, there}:
  "${toString this}:${toString there}")
  [{this = 1; should = 1; be = 1; there = 1;}]

Describe the solution you'd like

It would be handy to add a dictionary with all definitions (keys) and with severity (value) that could be changed by a user.

Describe alternatives you've considered

Warning sema-def-not-used seems to be the only warning that in some cases is wrong and therefore the easiest solution would be to change severity from warning to informational (blue squiggly line). That means forgotten bindings would be easy to locate within the code but wouldn't be too glaring.

@inclyc
Copy link
Member

inclyc commented Jun 29, 2024

On the main branch the warning sema-def-not-used has been changed to Hint level already, it should be released in 2.2.2, see release notes.

It would be handy to add a dictionary with all definitions (keys) and with severity (value) that could be changed by a user.

Nice idea! 👍

@inclyc inclyc added the enhancement New feature or request label Jun 30, 2024
@rudolfvesely
Copy link
Author

Fantastic, I've just upgraded and I have it.
image
Thank you!

Looking at the commit, I can see that the severity is Hint. I think Info would be a better option since Info doesn't show up in warnings / as an amber dot in the file browser but it still adds a squiggly line under the variable.

Before I upgraded to 2.2.2 sema-def-not-used helped me to realise why one of my functions doesn't work (I didn't use one of the function parameters) so it is useful.

@inclyc inclyc added the idea-approved Proposed idea is approved by at least 1 maintainers label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request idea-approved Proposed idea is approved by at least 1 maintainers
Projects
None yet
Development

No branches or pull requests

2 participants