rust-analyzer: Unused/inactive highlighting when file is not linked
rust-analyzer version: 4af21ffb026c7ec3a97a484ca27b36f703eb5fb1
Before an unlinked file (or a #[cfg(FALSE)] module) just had a small diagnostic for the first line. Now the whole file gets the visually marked as “unused”, which was implemented here: https://github.com/rust-lang/rust-analyzer/pull/17350.
The PR mentions:
Whilst this is marginally more prominent, it’s less invasive than a pop-up, and users do want to know why they’re getting no rust-analyzer support in certain files.
I agree it is less “invasive” compared to pop-up but now it’s also more visually distracting (or for me straight up annoying). My workflow quite often consists of workflows where I’ve got unlinked files in the work-tree and having the whole file “grayed out” it not great visually speaking.
There must be a better to do this. It might be interesting to see what RustRover is doing here. But for now I’ve reverted this change locally, so it’s not bugging me anymore.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 23 (23 by maintainers)
Commits related to this issue
- fix: Only show unlinked-file diagnostic on first line during startup This partially reverts #17350, based on the feedback in #17397. If we don't have an autofix, it's more annoying to highlight the ... — committed to Wilfred/rust-analyzer by Wilfred 2 years ago
- Auto merge of #17415 - Wilfred:unlinked_diagnostic_span, r=Veykril fix: Only show unlinked-file diagnostic on first line during startup This partially reverts #17350, based on the feedback in #17397... — committed to rust-lang/rust-analyzer by bors 2 years ago
If it wasn’t buggy, maybe it wouldn’t be so annoying?
How would you feel about having this being a diagnostic by default, and behind a off-by-default setting, the ability to upgrade it to a notification? For the users Wilfred and I are responsible for, we’ll make it a notification, but most rust-analyzer users won’t see, let alone complain about it.
Oh… I didn’t know that setting existed 😅 Thanks!
Disabling the diagnostic (
rust-analyzer.diagnostics.disabled) probably works.