How to dim inactive code block in Rust #31732
Replies: 2 comments 6 replies
-
|
It actually dims it, but all those underlines do not make it obviously visible. We need to do that in the code, something like https://github.com/zed-industries/zed/pull/31450/files#diff-2f5df760eaa9c247daa459cd907f63f8671deb28f42d49b17e0e902729824d13R289-R291 but in r-a already returns diagnostics with "not necessary" property set, but we cannot dim them all, as for unused So, we need to get a better heuristics: presumably, we can check whether such diagnostic spans multiple lines and avoid underlining such diagnostics only. |
Beta Was this translation helpful? Give feedback.
-
You're right.
I searched and found a rust-analyzer configuration like this: "lsp": {
"rust-analyzer": {
"diagnostics": {
"disabled": ["inactive-code"]
}
}
}Unfortunately, the underlines are still there. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As mentioned above, I am looking for ways to dim inactive code blocks due to #[cfg] directives in Rust similar to how VSCode handles it.
Currently, it displays warning underlines as shown in the image below.
Beta Was this translation helpful? Give feedback.
All reactions