grain
grain copied to clipboard
LSP: Unused Statements
We currently do not highlight unused variables and modules and such, it would be benifical if we sent information about if things are used or not through the lsp so editors can let people know something isnt being used.
I really like this. We would need the compiler to report these values back in a programmatic way
After the meeting today, it sounds like this needs quite a few compiler changes as we would want to implement these as warnings, and it would get very annoying if you wanted unused vars, so we need to add support for disabling warnings somehow.
I think we should also report these through the lap separately from other warnings using the DiagnosticTag
, unnecessary
and the severity of Hint
so it's not a warning but a hint. as given grain is compiled there is no good reason to warn about an unused var as it doesn't incur runtime cost or anything.
I think we should also look into reporting unused modules and types.