vts_gen_compile_db
Generate compile_commands.json for Unreal Engine projects, enabling clangd semantic analysis via UBT GenerateClangDatabase. Supports dry-run preview and apply mode, with out-of-tree or in-tree database placement.
Instructions
Generate compile_commands.json for an Unreal project (so clangd gets a full semantic index) by running UBT GenerateClangDatabase. The user's choice vs staying in no-DB text mode. DRY RUN by default (prints the exact command); apply=true runs it (takes minutes, needs the UE build env). The DB and clangd's .cache/ index land OUTSIDE the source tree (~/.vs-token-safer/db/) so git/p4 never see them; inTree=true keeps the classic project-root layout (then a VCS-ignore guard protects it).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | No | Unreal project root (contains the .uproject). | |
| apply | No | false (default) = print the command only; true = run UBT now. | |
| inTree | No | true = put the DB at the project root (classic layout, VCS-ignore-guarded) instead of the out-of-tree default. | |
| engineRoot | No | UE engine root (contains Engine/Build/BatchFiles/RunUBT). Default: VTS_UE_ROOT or a walk-up from the project. | |
| target | No | UBT target (default <ProjectName>Editor). | |
| platform | No | default Win64. | |
| config | No | default Development. | |
| compiler | No | default VisualCpp (needed for clang-cl targets). |