Get compile commands
get_compile_commandsRead exact compiler invocations from compile_commands.json, filtered by file, target, path pattern, or configuration to inspect build commands.
Instructions
Reads the exact compiler invocations from compile_commands.json in a build directory, filtered by file, path pattern, target and/or configuration. When file is given without buildDir, every build directory of the workspace that compiles the file is searched. Each entry has the working directory, the argument list, the original command string (when the database uses command) and the output file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Exact source file path (absolute or relative to a workspace root). | |
| limit | No | Maximum number of entries per build directory. | |
| filter | No | Source path filter: substring, glob or /regex/. | |
| target | No | Only commands compiling objects of this target. | |
| buildDir | No | Build directory (absolute, or relative to a workspace root). A source directory with a single build directory is also accepted. May be omitted when the workspace has exactly one build directory. | |
| configuration | No | Only commands of this configuration (multi-config generators; ignored otherwise). |