Replies: 3 comments 1 reply
-
There isn't a current option. I haven't tried it, but I think removing this line may be sufficient for it to work that way. |
Beta Was this translation helpful? Give feedback.
-
That line gets you 90% there. There are details though: tidy checks still won't see preprocessor events from the preamble. And the preamble has a cut-down AST (most function bodies missing), so checks won't see them. And this mode will be awfully, unusably slow as a regular language server. Using clangd as a tool for other workflows is a neat idea, but I don't think adding new options to support niche uses is sustainable. |
Beta Was this translation helpful? Give feedback.
-
Agreed on the usability point, but I'd suggest that even language server users (including myself) might appreciate having clangd be able to turn off those optimizations temporarily in order to be able to diagnose issues in a header / preamble file that only occur "in context". It's unfortunate how easy it is for this to happen in C: /* file: some-file.c */
#define TESTING
#include "some-header.h" /* file: some-header.h */
#pragma once
#ifdef TESTING
int __bad_decl;
#endif __bad_decl would get flagged by tidy's |
Beta Was this translation helpful? Give feedback.
-
My understanding is that today, clangd does not run clang-tidy checks on included files and only bubbles up errors from building
the AST. Is there a way to get it to actually run all of those checks on included files too?
I'm trying an approach where I use clangd as a command-line checker instead of an LSP (ala https://github.com/lljbash/clangd-tidy). This is super helpful for me to be able to use .clangd config files,
--query-driver
, and so on.Thanks for the awesome work!
Beta Was this translation helpful? Give feedback.
All reactions