Offer compiler quick fixes as code actions

Decode GCC SARIF fixes into bounded diagnostic edits through the same
physical-origin policy as locations; unprovable regions are dropped. A
bounded projection filters fixes to the requested range, deduplicates
and bounds them, and textDocument/codeAction serves them from retained
published diagnostics. Registered tests cover the SARIF binding and the
projection; a real stdio session returned the compiler's
Replace 'valu' with 'value' quickfix.
This commit is contained in:
faumaray committed 2026-12-05 15:03:21 +03:00
1 parent 624c24d028
commit 946b1a005e
15 files changed
+418 -10

No files matched your search

+5 -4
View File
@@ -18,6 +18,7 @@ missing part.
| textDocument/documentSymbol | `vls_index_tests` path query, real stdio session |
| textDocument/documentHighlight | `vls_feature_tests`, real stdio session |
| textDocument/selectionRange, foldingRange | `vls_feature_tests`, real stdio session |
| textDocument/codeAction (quickfix) | `vls_feature_tests` + `vls_diagnostic_tests`, real stdio session |
| workspace/symbol | stock occurrence corpus |
| voidLanguageServer/analysisStatus, providerStatus | stdio corpora |
| Debug adapter (DAP) separately through `vls-dap` | `vls_live_tests`, `vls_dap_tests` |
@@ -28,7 +29,7 @@ missing part.
| --- | --- |
| Compiler-native completion with visibility proof | index-backed completion is explicitly incomplete |
| Overload-set signature help | only the selected occurrence's signature is available |
| textDocument/codeAction, formatting | compiler-backed; needs a plan |
| textDocument/formatting | needs a plan |
| textDocument/semanticTokens, inlayHint | larger
| textDocument/codeLens, executeCommand | command surface not designed |
| callHierarchy / typeHierarchy | needs compiler call/type relationships |
@@ -38,6 +39,6 @@ missing part.
## Next slices
1. codeAction quick fixes from published diagnostics.
2. Semantic tokens from stock occurrences.
3. Formatting and inlay hints.
1. Semantic tokens from stock occurrences.
2. Formatting and inlay hints.
3. call/type hierarchy and code lens.
+1 -1
View File
@@ -102,7 +102,7 @@ ingests occurrence facts after each analysis and the server answers
Hash.hpp definition through it. Real persistence migrations and cross-file
rename coverage remain open.
Index-backed completion (roadmap 14 first slice) is implemented: `include/vls/features/Completion.hpp`, `src/features/Completion.cpp` and registered `vls_feature_tests` cover prefix extraction, filtering with replacement ranges, label+kind deduplication, deterministic ranking and bounds. `Server.cpp` advertises `completionProvider` and answers `textDocument/completion` from the symbol index through `EditorDiagnostics::completion`; a real stdio session with the stock observer returned `fnv1a64` and `fnv1a64_update` at a real call site. Every result is marked incomplete because the index does not prove visibility. Signature help is now served from the compiler-provided occurrence signature (parameter labels and ranges, active parameter, innermost call selection) and advertised by the server. Document symbols are served from the index by path and document highlights from same-binding occurrence facts; both are advertised and were exercised over stdio with the stock observer. Selection and folding ranges are served from immutable document snapshots with registered bounded cores. Compiler-native completion with visibility proof and deferred detail resolution remain open.
Index-backed completion (roadmap 14 first slice) is implemented: `include/vls/features/Completion.hpp`, `src/features/Completion.cpp` and registered `vls_feature_tests` cover prefix extraction, filtering with replacement ranges, label+kind deduplication, deterministic ranking and bounds. `Server.cpp` advertises `completionProvider` and answers `textDocument/completion` from the symbol index through `EditorDiagnostics::completion`; a real stdio session with the stock observer returned `fnv1a64` and `fnv1a64_update` at a real call site. Every result is marked incomplete because the index does not prove visibility. Signature help is now served from the compiler-provided occurrence signature (parameter labels and ranges, active parameter, innermost call selection) and advertised by the server. Document symbols are served from the index by path and document highlights from same-binding occurrence facts; both are advertised and were exercised over stdio with the stock observer. Selection and folding ranges are served from immutable document snapshots with registered bounded cores. Code actions now offer the compiler's own suggested fixes (quickfix) from retained published diagnostics, with SARIF fix decoding bound to the owner snapshot. Compiler-native completion with visibility proof and deferred detail resolution remain open.
The reflection provenance representation (roadmap 12 first slice) is
implemented as a bounded library with a registered suite: innermost-first
+22
View File
@@ -79,6 +79,28 @@ the upgraded snapshot (keeping `snapshot.prev.json`) and rewrites a legacy
about 25-30s in a Debug build (it passed VBS at ~27s); the full CMake run then
passed 18/18.
## December 5 code actions from compiler fixes
GCC's SARIF `fixes` are now decoded: `CompilerDiagnostic::fixes` carries a
bounded description plus edits whose deleted regions are converted through the
same physical-origin policy and owner-snapshot coordinates as locations. A fix
for another artifact, an unprovable region or an unbound snapshot is dropped,
never guessed. `include/vls/features/CodeActions.hpp` filters fixes to those
intersecting the requested range, deduplicates and bounds them, and
`EditorDiagnostics::code_actions` serves `textDocument/codeAction` (advertised
with `codeActionKinds: ["quickfix"]`) from the retained published diagnostics.
A real stdio session with the stock observer on `int main() { return valu; }`:
```
codeAction: 1
title: Replace 'valu' with 'value'
kind: quickfix preferred: True
edit: {"changes": {"file:///.../main.cpp": [{"newText": "value", "range": {"end": {"character": 24, "line": 1}, "start": {"character": 20, "line": 1}}}]}}
```
Registered cases cover the SARIF fix binding and the action projection;
`vls_diagnostic_tests` and `vls_feature_tests` passed, as did all 18 native
suites and all 18 CMake tests.
## December 5 selection and folding ranges
`include/vls/features/TextStructure.hpp` and