From 37d0049e7a7b55d40af6da1a884810a543fead22 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 16 Aug 2025 23:56:42 +0300 Subject: lsp: add 'Resolve diagnostics' code action scoped to selection - Parse diagnostics from CodeAction context; filter to overlap with selection - Build LLM prompt from selection-only diagnostics; replace only selected range - Keep existing 'Rewrite selection' action; return both when applicable - Add Diagnostic and CodeActionContext types; make CodeActionParams.Context raw JSON - Add helpers for range overlap; unit tests for filtering/overlap - Update README to document resolve-diagnostics action --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 6cd0827..9aeebca 100644 --- a/README.md +++ b/README.md @@ -116,10 +116,13 @@ action from the LLM and then clean up the tag automatically. ## Code actions -Hexai provides a code action for working with the current selection in Helix: +Hexai provides code actions that operate only on the current selection in Helix: -- Rewrite selection: Select code and invoke code actions. Hexai looks for the - first instruction inside the selection and rewrites the selection accordingly. +- Rewrite selection: Hexai looks for the first instruction inside the selection + and rewrites the selection accordingly. +- Resolve diagnostics: With a selection active, Hexai gathers only diagnostics + that overlap your selection and fixes them by editing only the selected code. + Diagnostics outside the selection are not modified. Instruction sources (first one found wins): - Strict marker: `;text;` (no space after first `;`, none before last `;`). -- cgit v1.2.3