-
-
Notifications
You must be signed in to change notification settings - Fork 37.8k
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
[Bug] compile_commands.json breaks VSCode clangd intellisense by defining non-existent macros #23968
Comments
Same issue here. Compiling and flashing run flawlessly, there seems to be something odd with the linter/LSP. For sanity I tried a fresh install of VSCode as well, making sure to blow out any existing settings and just following the QMK guides to the letter. Keyboard Useddraculad - but I've notice the bug on whatever keyboard I open. Operating SystemMacBook Air M2 macOS Sonoma 14.5 qmk doctor Output
Other keyboard-related software installed
Additional ContextAlso ran
Screenshot showing various error messages resulting.
|
There's obviously something going on with the compiler here; if I do Note that clang is not a participant at the point where I think the best we can do is to blacklist such entries. |
Yeah looks like it's an old compiler issue -- if I reissue the same command within the Will see if we can mitigate the old compiler issue rather than enforcing a higher version. |
Not sure if this solves OPs issues, but I'm still seeing erroneous linting errors. I've manually removed all instances of ![]() Updated compile_commands.json |
Did you restart the language server after regenerating the |
Yep! Even blew out the
Could that Edit: Grasping at straws, but I see a possibly related issue to do with cross compilation and |
Honestly not sure; I've been using gcc 14 for a while and don't strike any of these issues. I'll try and replicate on an older system later today. |
If you've got some familiarity with setting up things on your |
Not entirely sure how to switch the toolchain via the path.
but I'm still seeing the errors and Not entirely sure where to poke around at next, but happy to keep trying things! |
I’d suggest rolling this back — you’ve changed the compiler targeting your MacBook — I was suggesting changing the compiler targeting the chip for QMK. Two completely different beasts. For now I’d hold off on making any more changes (after rolling back above); I’m seeing if I can do something with toolchain management baked into the QMK CLI itself. |
Yikes, rolled back! thank you for the support on all of this, wild how much goes into some "simple" linting and syntax highlighting |
I only removed these specific flags because VSCode was throwing Maybe find which header files your types are defined in and checking if they're included in |
Describe the Bug
compile_commands.json
includes the following macro definitions:-D __has_include(STR)=__has_include__(STR)
and-D __has_include_next(STR)=__has_include_next__(STR)
This causes clangd to break VSCode's intellisense, emitting
macro not defined
errors.Removing these flags from the
compile_commands.json
ended up fixing the issue for me.Keyboard Used
keebio/quefrency/rev4
Link to product page (if applicable)
https://keeb.io/products/quefrency-rev-4-65-split-staggered-keyboard?_pos=13&_sid=e65f328e4&_ss=r
Operating System
MacBook Pro M1 Pro macOS Sonoma 14.5
qmk doctor Output
No response
Is AutoHotKey / Karabiner installed
Other keyboard-related software installed
QMK Toolbox
Additional Context
qmk compile --compiledb -kb keebio/quefrency/rev4 -km default
was run first.clangd
version = 18.1.3 (VSCode clangd extension latest install)The text was updated successfully, but these errors were encountered: