Add clangd navigation helper

This commit is contained in:
2026-06-04 16:03:03 +02:00
parent bc3973ef15
commit 576b58b061
4 changed files with 473 additions and 0 deletions

View File

@@ -61,6 +61,25 @@ generated build tree target before judging source changes:
cmake --build --preset windows-msvc-default --config Debug --target clean
```
## Code Navigation
Prefer compiler-aware navigation when following C++ symbols across the legacy
flat source tree and extracted components:
```powershell
python scripts/dev/clangd_nav.py symbols --file src/app_core/brush_ui.h --name execute_brush
python scripts/dev/clangd_nav.py definition --file src/node_panel_brush.cpp --line 511 --column 39
python scripts/dev/clangd_nav.py references --file src/app_core/brush_ui.h --line 783 --column 45
```
The helper talks to `clangd` using an existing `compile_commands.json`. It
defaults to `out/build/windows-clangcl-asan` and then `out/build/android-arm64`;
pass `--compile-commands-dir` or set `PP_CLANGD_COMPILE_COMMANDS_DIR` when using
another Ninja build tree. Use `--name` and `--max-results` to keep output small.
References are fast/current-translation-unit by default; add
`--background-index` only when broader cross-file references are worth the extra
indexing work.
## Current Architecture Direction
The desired component split is documented in the roadmap. Current extracted or