-
-
Notifications
You must be signed in to change notification settings - Fork 39.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
New CLI subcommand to create clang-compatible compilation database (compile_commands.json
)
#14370
Conversation
Any time I try to execute it gives this error, regardless of the parameters:
You'll also need to remove the debugging statements when printing out loading of modules. |
Hmm, I have those settings saved to my config so I didn't notice that. I'll figure it out
agh I didn't realize I committed those print statements. that's embarrassing 😅 |
Fixed the issue. I missed the config parameters when I renamed the subcommand, so they weren't being parsed correctly. Also added error handling for the case where no commands were generated (e.g. you specified a non-existent keymap) and some minor improvements (instead of checking checking exit status or calling |
Now using We will still likely need to fix the |
Just a quick note of thanks, this PR has helped me make vscode a lot happier about qmk 👏 |
* qmk/develop: (69 commits) Use opendrain pin with external pullup again (qmk#14474) Add i2c defaults for Convert to Proton C (qmk#14470) [Keyboard] Increase the way to add oled code for helix/rev3. (qmk#14426) [Bug] fix logical minimum in Programmable Button rdesc (qmk#14464) Adds optional hebrew layout (Unicode) (qmk#14156) New CLI subcommand to create clang-compatible compilation database (`compile_commands.json`) (qmk#14370) [Keyboard] Add the Idobao ID96 keyboard (qmk#14371) [Keyboard] Add FJLabs TF60 Variants and TF65 Variant (qmk#14392) [Keyboard] Add Absolute Designs AD65 Keyboard (qmk#14391) [Bug] Fix descriptor for USB Programmable Buttons (qmk#14455) Make ChibiOS PAL interactions less STM32 specific - Round 2 (qmk#14456) core: fix compilation issues with USB programmable buttons (qmk#14454) [Keyboard] add Matrix Me (qmk#14331) [Keyboard] Replaced Maker Keyboards & FJLabs Legacy Code (qmk#14393) [Keyboard] Add `NO_LED` positions to match key matrix. (qmk#14417) [Keymap] A slight improvement to my own ErgoDox keymap (qmk#14425) [Keymap] Trying again with Prime-e update! (qmk#14429) [Keyboard] Update lighting effects for xbows keyboard (qmk#14432) [Docs] add sync options heading, update led indicators (qmk#14441) [Bug] Fix IS31fl3741 driver to accept 1 or 2 addresses (qmk#14451) ...
…compile_commands.json`) (qmk#14370) * pulled source from dev branch * missed a file from origin * formatting * revised argument names. relaxed matching rules to work for avr too * add docstrings * added docs. tightened up regex * remove unused imports * cleaning up command file. use existing qmk dir constant * rename parser library file * move lib functions into command file. there are only 2 and they aren't large * currently debugging... * more robustly find config * updated docs * remove unused imports * reuse make executable from the main make command * pulled source from dev branch * missed a file from origin * formatting * revised argument names. relaxed matching rules to work for avr too * add docstrings * added docs. tightened up regex * remove unused imports * cleaning up command file. use existing qmk dir constant * rename parser library file * move lib functions into command file. there are only 2 and they aren't large * currently debugging... * more robustly find config * updated docs * remove unused imports * reuse make executable from the main make command * remove MAKEFLAGS from environment for better control over process management * Update .gitignore Co-authored-by: Michael Forster <[email protected]> * add a usage line to docs * doc change as suggested Co-authored-by: Nick Brassel <[email protected]> * rename command * remove debug print statements * generate-compilation-database: fix arg handling * generate-comilation-db: improve error handling * use cli.run() instead of Popen() Co-authored-by: Xton <[email protected]> Co-authored-by: Christon DeWan <[email protected]> Co-authored-by: Michael Forster <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
Trying to use this I still have a few issues in vscode in keymaps after generating the database:
and
Do I need specific clangd options or anything I am missing? Compiling an flashing work fine though 🤔 |
…compile_commands.json`) (qmk#14370) * pulled source from dev branch * missed a file from origin * formatting * revised argument names. relaxed matching rules to work for avr too * add docstrings * added docs. tightened up regex * remove unused imports * cleaning up command file. use existing qmk dir constant * rename parser library file * move lib functions into command file. there are only 2 and they aren't large * currently debugging... * more robustly find config * updated docs * remove unused imports * reuse make executable from the main make command * pulled source from dev branch * missed a file from origin * formatting * revised argument names. relaxed matching rules to work for avr too * add docstrings * added docs. tightened up regex * remove unused imports * cleaning up command file. use existing qmk dir constant * rename parser library file * move lib functions into command file. there are only 2 and they aren't large * currently debugging... * more robustly find config * updated docs * remove unused imports * reuse make executable from the main make command * remove MAKEFLAGS from environment for better control over process management * Update .gitignore Co-authored-by: Michael Forster <[email protected]> * add a usage line to docs * doc change as suggested Co-authored-by: Nick Brassel <[email protected]> * rename command * remove debug print statements * generate-compilation-database: fix arg handling * generate-comilation-db: improve error handling * use cli.run() instead of Popen() Co-authored-by: Xton <[email protected]> Co-authored-by: Christon DeWan <[email protected]> Co-authored-by: Michael Forster <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
@Diaoul Hi, did you manage to solve this problem? |
Description
Updating @xton's PR #10264, which adds a CLI command to generate a Clang Compilation Database file, for use with language servers, linters, and other tooling. No major changes other than addressing merge conflicts.
I changed the subcommand name, as was requested in the review for the previous PR, but to
generate-compilation-database
instead ofgenerate-compile-commands
as @skullydazed suggested. This seems more aligned with how the file is referred to in compatible tools' documentation. But I can change this if needed.Types of Changes
Issues Fixed or Closed by This PR
Checklist