diff options
author | Bao <qubidt@gmail.com> | 2021-09-15 23:59:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-16 14:59:57 +1000 |
commit | 590b405468fec906a51767a5cda4aa30ada5d52f (patch) | |
tree | 0c907b8836440475e7b2800737800f4d50d81649 /docs | |
parent | f7054522106644a5fd9ee58b5117a44b3209b7b2 (diff) | |
download | qmk_firmware-590b405468fec906a51767a5cda4aa30ada5d52f.tar.gz qmk_firmware-590b405468fec906a51767a5cda4aa30ada5d52f.zip |
New CLI subcommand to create clang-compatible compilation database (`compile_commands.json`) (#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>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/cli_commands.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/cli_commands.md b/docs/cli_commands.md index 06568afb4..1427b592f 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md | |||
@@ -320,6 +320,33 @@ qmk format-c | |||
320 | qmk format-c -b branch_name | 320 | qmk format-c -b branch_name |
321 | ``` | 321 | ``` |
322 | 322 | ||
323 | ## `qmk generate-compilation-database` | ||
324 | |||
325 | **Usage**: | ||
326 | |||
327 | ``` | ||
328 | qmk generate-compilation-database [-kb KEYBOARD] [-km KEYMAP] | ||
329 | ``` | ||
330 | |||
331 | Creates a `compile_commands.json` file. | ||
332 | |||
333 | Does your IDE/editor use a language server but doesn't _quite_ find all the necessary include files? Do you hate red squigglies? Do you wish your editor could figure out `#include QMK_KEYBOARD_H`? You might need a [compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html)! The qmk tool can build this for you. | ||
334 | |||
335 | This command needs to know which keyboard and keymap to build. It uses the same configuration options as the `qmk compile` command: arguments, current directory, and config files. | ||
336 | |||
337 | **Example:** | ||
338 | |||
339 | ``` | ||
340 | $ cd ~/qmk_firmware/keyboards/gh60/satan/keymaps/colemak | ||
341 | $ qmk generate-compilation-database | ||
342 | Ψ Making clean | ||
343 | Ψ Gathering build instructions from make -n gh60/satan:colemak | ||
344 | Ψ Found 50 compile commands | ||
345 | Ψ Writing build database to /Users/you/src/qmk_firmware/compile_commands.json | ||
346 | ``` | ||
347 | |||
348 | Now open your dev environment and live a squiggly-free life. | ||
349 | |||
323 | ## `qmk docs` | 350 | ## `qmk docs` |
324 | 351 | ||
325 | This command starts a local HTTP server which you can use for browsing or improving the docs. Default port is 8936. | 352 | This command starts a local HTTP server which you can use for browsing or improving the docs. Default port is 8936. |