โ– humdrum codex / glint v1.1.2
license AGPL-3.0

โ† issues

TASK-044 Grammar suggestions & ignore via Harper codeAction

๐Ÿ Done feature priority: medium

created 2026-07-14 15:48 ยท updated 2026-07-14 19:29

Description

Wire Harper's fixes/ignore into the Alt+; popup. Currently glint only renders green grammar underlines (TASK-043). Harper advertises codeActionProvider + executeCommand commands (HarperIgnoreLint, HarperAddToUserDict, HarperAddToFileDict, HarperAddToWSDict). Add: on a grammar span at cursor/click, send textDocument/codeAction for the diagnostic range -> show returned fixes as replacement rows in the proofing popup (reuse spellOption/applySpell plumbing); Ignore -> executeCommand HarperIgnoreLint; Add to dict -> HarperAddToUserDict. Needs: LSP client request/response correlation (id->reply channel; the current client only fires notifications + answers server requests), codeAction result parsing (WorkspaceEdit / Command), and mapping the grammar Diag back to harper's diagnostic (code+range). Store the raw LSP diagnostics (code, range, data) alongside the rune-mapped Diag so codeAction can reference them.

Acceptance Criteria

Implementation Notes

Implemented via generic relay of harper codeAction results. Live-probed harper-ls 2.6: replacement quickfixes work great; HarperIgnoreLint is a no-op over LSP and harper offers no add-to-dict for grammar lints. So: (1)(2) replacement fixes wired into the Alt+; popup (grammar package request/response correlation + CodeActions mapping UTF-16 edits to rune coords; app applyGrammarFix applies edits last-first); (3) Ignore is glint-side session ignore keyed by rule+text, mirroring spell IgnoreWord (resets next launch); (4) add-to-dict dropped โ€” not offered by harper for grammar. Bonus: fixed workspace/configuration reply to wrap under {"harper-ls":{}} (was triggering harper's 'Settings must contain a harper-ls key' error). Spec: docs/superpowers/specs/2026-07-14-harper-grammar-actions-design.md