ID |
|
|---|---|
Status |
Backlog |
Bucket |
architecture |
Priority |
7 |
Theme |
lsp |
Created |
2026-08-19 |
Updated |
2026-08-19 |
Consolidate LSP byte-range result construction and rewrite/dedup nits
Residue of a discarded consolidation umbrella whose shipped slices left graphitron-lsp with
one navigation home (Nodes / GraphqlNodeKind), one directive-policy table (DirectivePolicy),
and one completion dispatcher (Completions), and whose remaining premises the fact-store
migration made moot. Three small facts survived a 2026-08-19 audit of the module and are worth
one polish pass:
-
Outbound byte-range → lsp4j
Rangeconstruction has no single home. The inbound direction is consolidated (Positionsowns LSP position → byte offset), but the outbound build is re-implemented inHovers,DeclarationHovers, and a few sites inDiagnostics. A small shared helper (thePositionssibling direction) retires the copies. -
CodeActionsruns each rewrite three times per match. The partition into apply / preview / edit maps the sameaction.rewrite().rewrite(file, m)over the match list three times (CodeActions.java:178/186/193); materialize the result once per match, then partition. -
The recalc queue dedups by linear scan.
Workspace.enqueueTouchedguards its add withList.contains(Workspace.java:346); aLinkedHashSetkeeps order and drops the O(n) probe.
All three are behaviour-preserving; the existing graphitron-lsp test suite is the oracle.
Verify each claim against the tree before starting, since the module moves quickly.