-
-
Notifications
You must be signed in to change notification settings - Fork 42.4k
New CLI subcommand to create clang-compatible compilation database (compile_commands.json)
#14370
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
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 👏 |
…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 <forster@google.com> * add a usage line to docs * doc change as suggested Co-authored-by: Nick Brassel <nick@tzarc.org> * 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 <cdewan@apple.com> Co-authored-by: Christon DeWan <cmdpix@mac.com> Co-authored-by: Michael Forster <forster@google.com> Co-authored-by: Nick Brassel <nick@tzarc.org>
|
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 <forster@google.com> * add a usage line to docs * doc change as suggested Co-authored-by: Nick Brassel <nick@tzarc.org> * 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 <cdewan@apple.com> Co-authored-by: Christon DeWan <cmdpix@mac.com> Co-authored-by: Michael Forster <forster@google.com> Co-authored-by: Nick Brassel <nick@tzarc.org>
|
@Diaoul Hi, did you manage to solve this problem? |
|
No, I gave up. |

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-databaseinstead ofgenerate-compile-commandsas @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