-
Notifications
You must be signed in to change notification settings - Fork 255
dead_code and unused* lint are annoying #252
Comments
I'm not sure about unused var lint. Other IDEs, in general, do show the warnings all the time. It shouldn't take too much time from introducing the variable to actually using it and additionally when we hide the warnings when developer is editing current function we miss the main opportunity to warn him, since I'd say most of the time he'll look at the code when he's editing it. |
I think in case of unused (yet) functions, it would be better to highlight only the function identifier or just the first line, not the whole function body. It looks really messy when half of the screen gets underlined. |
That's a rustc issue. We need to fix it there |
Warnings can now be hidden by a config option in vscode: |
Adding |
strangely, I see this too, but only if I start with it unset. If I start with it as true, then set to false, there is no problem :-s |
Ok, I got it to not panic somehow, but show_warnings is not working for some reason.
None of which seem to work. Not sure why, but I will look into it. |
this should work. VSCode should give you hints when typing too. You'll need to be using the plugin from https://github.com/rust-lang-nursery/rls-vscode, not the one from the marketplace |
We should probably offer something clever like, only show warnings on lines where no typing has happened in the last 1 minute, or something like that. Anyway, now that we can hide warnings, I don't think this is p-high any more. |
One approach we might consider is allow the user to silence a list of diagnotic codes, which seems customizable but then again I'm not sure users will want to be as flexible (I'd like to silence E0123, then E1911, also throw some E1337 with that...). An interesting approach that VSCode experiments with is diagnostic tags microsoft/vscode#51104 - IIRC the first ones are around code that's unnecessary (unused, dead) and it changes the way these are rendered, so that might be one solution to this particular problem. LSP equivalent - microsoft/language-server-protocol#500 |
While writing new code, rls complains about unused variables and similar. But often the variable is unused, because it was just created and we plan on using it a few lines down.
I suggest to create a whitelist of lints and errors, which rls should not display inside the function in which the cursor currently is in or which was last edited.
The text was updated successfully, but these errors were encountered: