Skip to content

LSP: go-to-definition and hover on a reference block #107

Description

@aslakhellesoy

Follow-up to #104 (ADR 0016).

A reference block is currently inert in the editor beyond ordinary Markdown link rendering. Three things would earn their keep:

  • Go-to-definition on the link → the referenced heading. Obvious, and cheap: references(doc) already resolves the target path and slug purely.
  • Hover showing the resolved steps. This is the one that matters. ADR 0016 argues references are for setup the reader must see; a hover that resolves the chain and shows the steps inline keeps that true at the point of use, and keeps a deep chain readable despite itself.
  • Diagnostics on the block for reference-not-found / reference-empty / reference-cycle. The planner already emits these with a span on the reference block, so they should surface as squiggles — worth confirming they already do via the existing diagnostic rail rather than assuming.

The workspace index has everything needed: buildWorkspaceIndex holds every parsed doc and the reference topology (WorkspaceIndex.workspace).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions