[clang-tools-extra] [clangd] Add quick fix to automatically adds NOLINTNEXTLINE comment (PR #114661)
kadir çetinkaya via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 4 05:27:55 PST 2024
https://github.com/kadircet requested changes to this pull request.
thanks a lot for this patch!
I am not sure if this is a "good" fix-it for C++ ecosystem. As it'll make suppression way easier. Today people needs to decide whether a suppression is warranted, and explain it in a comment. at that point the cost of figuring out how to suppress a finding and typing the characters are definitely not the bottleneck. Whereas after this change people will always have this available with a single click, and they'll consider the issue is "fixed" without any investigation (i know this doesn't sound "right", but speaking from experience, that's how people treat fixes provided by their compiler, even if it just says suppress).
That being said, if majority of people here is convinced this is a useful fix to have in clangd, can we at least use `FeatureModules` infrastructure instead? https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clangd/unittests/FeatureModulesTests.cpp shows some of the intended use case. It was meant to provide a way to extend clangd functionality without modifying core logic (as you do here). You can attach an ASTListener to look for all the diagnostics and provide a tweak contributor to attach fixes when an interesting diagnostic is part of the selection.
https://github.com/llvm/llvm-project/pull/114661
More information about the cfe-commits
mailing list