nixd icon indicating copy to clipboard operation
nixd copied to clipboard

Changing default severity

Open rudolfvesely opened this issue 1 year ago • 2 comments

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.

rudolfvesely avatar Jun 29 '24 16:06 rudolfvesely

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 avatar Jun 29 '24 18:06 inclyc

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.

rudolfvesely avatar Jun 30 '24 13:06 rudolfvesely