-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some clang-tidy warnings get struck-through #482
Comments
|
At the protocol level this is caused by the affected diagnostics having the |
|
So one way to disable it in vscode is to set
Does the "deprecated code" situation apply to C++? If yes, could you show an example? If not, then scoping the setting to just C++ should do it: "[cpp]": {
"editor.showDeprecated": false
} |
|
Ok, so that one is a So, is your suggestion that clangd should send a Conceptually the two seem similar ("you're using an old thing, you could be using a newer thing instead"). |
|
You're not wrong, although explicitly marking something as deprecated does seem like a stronger signal than the Truthfully, though, the main issue with the strikethrough comes from my example of typedef'ed enums, where it obscures important information. And that could probably be solved by changing the highlight region to just be on the Until that gets changed there (if it does), would it be worth removing the strikethrough for |
Yeah, narrowing the diagnostic range to just the
The diagnostic is produced by clang-tidy, clangd just passes it through without modifying most properties like the diagnostic range, so the place to file that issue would be https://github.com/llvm/llvm-project/issues which is where clang-tidy issues are tracked. (Please feel free to drop a link to it here once you've filed it.)
cc @sam-mccall, who wrote the patch to use the I don't have a strong opinion either way. If this were to come up in a project I'm working on, my approach would be to use a |
|
clang-tidy issue: llvm/llvm-project#62702 |
|
The The end-to-end UX is poor here but there are many loosely-coupled layers involved (clang diagnostics, clang-tidy, specific check, clangd, LSP, vscode UI) and I think it's reasonable to expect the occasional wart. Practically I agree that reducing the diagnostic range for this particular check is a good fix: it's the use of (If clangd's heuristics to pick a range are preferring the fixit range over the diag loc, maybe we can add SourceRange(Loc, Loc) to the diag to suppress) |
|
FWIW, as noted this affected other checks too. I think there's a good case to be made that clang-tidy ought not to be issuing |
|
Not sure if this helps at all, but https://reviews.llvm.org/D154443 downgrades the severity of diagnostics with the |

Some clang-tidy warnings are displayed with a strikethrough. From what I can tell, this happens with modernize- lints but not e.g. bugprone- or unused-includes. This is a recent development, previously they just had an orange underline. This, combined with the expansive way the error can be defined, can make it hard to read some things (crossing out all hundred lines of a
typedefed enum makes it pretty hard to skim).If this is considered desired behavior I would appreciate if someone could tell me a workaround to shut it off locally (preferably while maintaining the strikethrough behavior for deprecated code)
System information
Clangd version (from the log, or
clangd --version): 16.0.2clangd extension version: v0.1.24
The text was updated successfully, but these errors were encountered: