Complete LSP citation authoring with ID completion - #477
Merged
Merged
Conversation
Keep underscore token/edit assertions independent of the existing scanner limitation tracked in grund.57. Add resolving hyphen controls for canonical whole-token edits and navigation/on-type/formatting replay (§FS-lsp.1.6.3, §FS-lsp.1.6.4). Restore the embedded-value component's original heading depth (§FS-values.2.4.3), preserving the relocated examples and README budget (§REQ-readme.1, §REQ-readme.2).
vjovanov
force-pushed
the
fix/issue-472
branch
from
October 6, 2026 02:14
2c07c47 to
9212d43
Compare
vjovanov
marked this pull request as ready for review
October 6, 2026 02:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #472
Before,
grund-lspoffered no suggestions for a partially written citation. Now, in a Markdown note in this repository, request completion after either prefix, chooseFS-lsp(“grund ships an optional LSP server”,docs/functional-spec/FS-lsp.md), and accept with the editor's normal binding:The server advertises and handles
textDocument/completion. The new declared-ID contract is §FS-lsp.1.6; completion leaves the reserved list in §FS-lsp.1.5, and the shell specification points editor readers to this separate cached surface (§FS-completions)./selects a loaded target's catalog and grammar. Ambiguous declarations and incomplete discovery withhold edits. Items include titles and project-relative source paths; case-sensitive prefix matches sort by exact match, configured kind order and ID, with explicitsortTextandfilterText(§FS-lsp.1.6.2).Core owns recognition, candidate selection and byte edits; LSP owns capability advertisement, protocol items and UTF-16 conversion. The additive completion context and snapshot wrapper preserve existing public constructors (§AR-lsp.1, §AR-lsp.2). This adds no CLI/config migration, value-specific completion or editor extension. Ordinary declared-ID candidates remain the value behavior in §FS-lsp.4.2.
The shipped live transform retains its timing: trigger conversion waits for a recognized suffix, while numeric shorthand expansion waits for its token boundary (§FS-lsp.1.4.1). Its distinct expansion and eager-conversion exclusions remain intact (§FS-lsp.1.4.3, §FS-lsp.1.4.4); baseline investigation found no generic trigger defect requiring a rewrite.
The setup guide documents client-owned acceptance and response handling for VSCode, Neovim, Zed, Helix and Emacs, with optional mappings where needed. Helix cycles with Tab and accepts with Enter; the server does not intercept keys (§FS-lsp.2.3). This guidance was checked against official sources; interactive editor validation is not claimed. Optional README depth moved into linked user guides, preserving runnable examples and keeping the README at 250 nonblank lines. The final integration commit restores the rules-example link, inventories four additive core exports and replaces three timed-out Emacs manual links with corresponding reachable manual-source mirror links.
Verification
The specification and original 22 protocol acceptance cases were committed first in
697b51001f. Their baseline failures independently pin the absent completion provider and unsupported requests (-32601); those cases were preserved throughout implementation and both review/fix rounds. Added core and protocol coverage pins configured introducer/grammar overlap, whole-token and UTF-16 edits, neighbor preservation, owner/qualified isolation, protected contexts, overlays, and completion/on-type response sequences. Resolving default/hyphen-marker controls verify accepted-citation navigation and formatting/on-type replay; underscore-marker cases prove token/edit behavior only. Deterministic completion and acceptance parity are now explicit in §FS-lsp.4 and §FS-lsp.4.1.At final commit
2c07c4762631d9aba379c1f02335c82c99dd300a,pre-commit run --all-filesexited 0 in 7m02s. All ten hooks passed: Cargo formatting, warnings-as-errors workspace/all-targets build, workspace/all-targets tests withgrund/test-workspace-load-count, Python tests, grounding, citation formatting, managed-block checking, links, file budgets and attribution checking. Focused rules-documentation, public-inventory and link retries also passed before the complete rerun. No gate bypass or budget exception was used. The grounding/formatting hooks run the checkout throughcargo run; they do not use the older installed formatter discussed below. Hosted CI and merge are not yet established.Adjacent limitations deliberately deferred
These findings predate this feature and remain with their separate tool reports:
listbutshowcannot resolve them.0.15.1-devcan write wrong relative link destinations when formatting a bare file argument. Committed links were repaired, and fresh absolute-path formatting controls pass.The author approved the unchanged planned proposal; it declared no prerequisites. #466 and #459 remain coordination concerns. Clarify and agora were cancelled as unnecessary. Both review/fix rounds ran, with all four review/fix steps escalated for incomplete delivery; green made one bounded documentation/integration fix before the passing complete rerun.
Held for human discussion. Membership in the 1.0 work and implementation order remain undecided; this is not a release commitment.
AI workflow: `rhei`, 20 agent invocations across 1 model; 11 tasks completed, 5 in progress.
github-issues-agent-grounds-grund-472-implement-076ca082.ticketsupervising (visit 1) — cdx, openai/gpt-6.1-sol — 1m32s — 371.4k in / 3.8k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticket.triageassessing — cdx, openai/gpt-6.1-sol — 9m57s — 2.7M in / 25.0k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticketsupervising (visit 2) — cdx, openai/gpt-6.1-sol — 2m28s — 768.0k in / 6.1k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticket.planplanning — cdx, openai/gpt-6.1-sol — 5m37s — 2.0M in / 12.9k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticketsupervising (visit 3) — cdx, openai/gpt-6.1-sol — 1m21s — 430.8k in / 3.4k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticketsupervising (visit 4) — cdx, openai/gpt-6.1-sol — 1m36s — 439.0k in / 4.2k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticket.specifyspecify — cdx, openai/gpt-6.1-sol — 15m27s — 6.1M in / 38.1k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticketsupervising (visit 5) — cdx, openai/gpt-6.1-sol — 1m57s — 502.5k in / 4.9k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticket.implementimplement — cdx, openai/gpt-6.1-sol — 24m02s — 8.3M in / 57.7k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticketsupervising (visit 6) — cdx, openai/gpt-6.1-sol — 3m05s — 989.5k in / 7.9k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticket.review-1review — cdx, openai/gpt-6.1-sol — 6m34s — 1.8M in / 16.1k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticketsupervising (visit 7) — cdx, openai/gpt-6.1-sol — 1m45s — 546.0k in / 4.5k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticket.fix-1fix — cdx, openai/gpt-6.1-sol — 11m06s — 3.1M in / 27.4k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticketsupervising (visit 8) — cdx, openai/gpt-6.1-sol — 1m51s — 551.9k in / 4.7k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticket.review-2review — cdx, openai/gpt-6.1-sol — 8m47s — 2.7M in / 22.6k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticketsupervising (visit 9) — cdx, openai/gpt-6.1-sol — 2m06s — 726.6k in / 5.4k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticket.fix-2fix — cdx, openai/gpt-6.1-sol — 6m08s — 1.4M in / 16.5k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticketsupervising (visit 10) — cdx, openai/gpt-6.1-sol — 1m49s — 608.1k in / 4.7k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticket.greengreen-fix — cdx, openai/gpt-6.1-sol — 3m15s — 1.4M in / 7.4k outgithub-issues-agent-grounds-grund-472-implement-076ca082.ticketsupervising (visit 11) — cdx, openai/gpt-6.1-sol — 2m12s — 792.5k in / 5.6k out