Add regex filters to clangd navigation

This commit is contained in:
2026-06-04 17:12:14 +02:00
parent 104358bc62
commit be4b88dec8
5 changed files with 182 additions and 28 deletions

View File

@@ -77,7 +77,10 @@ powershell -ExecutionPolicy Bypass -File scripts\automation\package-smoke.ps1 -P
cmake --fresh --preset windows-clangcl-asan
python scripts/dev/clangd_nav.py symbols --file src/app_core/brush_ui.h --name execute_brush
python scripts/dev/clangd_nav.py symbols --file src/app_core/brush_ui.h --name-regex "execute_.*preset"
python scripts/dev/clangd_nav.py symbols --file src/app_core/document_export.h --detail-regex "Export.*Plan"
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 --path-regex "src[\\/]app_core"
python scripts/dev/clangd_nav.py self-test
```
Known local toolchain state:
@@ -97,9 +100,15 @@ Known local toolchain state:
the current `compile_commands.json` from `windows-clangcl-asan`,
`android-arm64`, or a caller-provided build directory. Symbol, hover,
declaration, definition, and implementation lookups are the reliable use case.
Symbol listing supports substring filtering with `--name` and regex filtering
against `qualifiedName` with `--name-regex`; regex matching is case-insensitive
by default and can be made case-sensitive with `--no-ignore-case`.
Symbol listing supports substring filtering with `--name`, regex filtering
against `qualifiedName` with `--name-regex`, and symbol detail/signature
regex filtering with `--detail-regex`. Definition, declaration,
implementation, and reference location output supports `--path-regex` for
path/URI filtering. Regex matching is case-insensitive by default and can be
made case-sensitive with `--no-ignore-case`. The helper exposes
`python scripts/dev/clangd_nav.py self-test`, also registered as
`panopainter_clangd_nav_regex_self_test`, so regex filter behavior can be
validated without clangd or a compile database.
Reference lookup is guarded because a one-shot clangd process may not have a
complete project index: pass `--background-index` for broader best-effort
results or `--allow-incomplete-references` for explicitly

View File

@@ -317,7 +317,10 @@ with JSON automation commands for app document-open routing, app session
dirty-state and save decisions, creating a `pp_document` model, metadata-only
PPI project loading, and inspecting image signatures, PPI headers, and layout
XML; full document/app integration is debt-tracked as DEBT-0010 and full PPI
body parsing is debt-tracked as DEBT-0013.
body parsing is debt-tracked as DEBT-0013. Agent code navigation now includes
`scripts/dev/clangd_nav.py` with symbol/detail/path regex filters and a
`panopainter_clangd_nav_regex_self_test` CTest so broad symbol-family searches
can be validated before they guide refactors.
Implementation tasks: