0%

§06 LSP — capset hover + autocomplete

Goal

Wire the LSP integration to surface capset metadata via hover + autocomplete. Stretch goal beyond the core 5-section feature delivery.

Implementation Sketch

This section depends on §03 (typeck) shipping the capset registry — LSP queries the same CapsetRegistry::expand(name) API to render hover content. Autocomplete enumerates capsets from the registry alongside capability traits from the trait registry.

LSP integration in Ori currently lives in compiler_repo/compiler/oric/ driver code (verify via scripts/intel-query.sh file-symbols "compiler_repo/compiler/oric/" --repo ori). If a dedicated LSP crate has not yet shipped, this section is gated on the LSP crate creation; declare that gating via a blocked-by: pointer to whatever section ships the LSP crate (TBD as of this plan’s creation).

Implementation Items

  • Inventory LSP integration surface — locate the hover handler + autocomplete handler in the Ori LSP server. Run scripts/intel-query.sh file-symbols "lsp" --repo ori and grep for hover / completion patterns.
  • Wire hover on capset reference (in uses clause member position) to call CapsetRegistry::expand(name) and render the expansion as markdown.
  • Wire hover on capset declaration line to render the transitive expansion when members are themselves capsets.
  • Wire autocomplete in uses clause member position to enumerate CapsetRegistry entries alongside the trait registry’s capability traits.
  • Differentiate capsets from capability traits in autocomplete output via kind: alias or (capset) suffix marker per LSP convention.
  • Rust Tests: LSP integration tests covering hover + autocomplete cases.
  • Manual Tests: open a tests/spec/capabilities/capset.ori file in the editor, verify hover + autocomplete behave correctly.

Spec References

  • Proposal compiler_repo/docs/ori_lang/proposals/approved/capset-proposal.md §LSP support (if present in proposal body) — verify scope of LSP claims.
  • Spec 20-capabilities.md §20.11.

Tests

LSP integration tests live in their crate’s tests/. Section §05 covers the language-level spec tests; this section covers tooling-level tests.

Intelligence Reconnaissance

scripts/intel-query.sh file-symbols "lsp\|language_server\|completion\|hover" --repo ori to locate the LSP integration surface. scripts/intel-query.sh similar "alias_hover" --repo rust,swift,koka --limit 5 for prior-art LSP rendering patterns of transparent aliases.

Roadmap drain

When this section lands, the §6.13 LSP support checkboxes (Show capset expansion on hover, Autocomplete capset names in uses clauses) close via blocked-by linkage.