Skip to content

AST: end positions on Span/Token and spans for Block, Param and class members #451

Closed

Description

@blacktrs

Why

Span carries only the start (line, column, file) of a node. Hover, rename, document symbols, folding and diagnostic underlines need ranges. Block, Param and several class parts have no span at all.

Scope

  • Append endLine/endColumn to Span and Token (AST field order is load-bearing: append only, keep children() in sync).
  • Parser sets the end when a node completes (73 span sites).
  • Spans for Block, Param, class members, attribute groups.
  • Real source spans (or an explicit synthetic marker) for string-interpolation parts and hoisted anonymous classes.

Acceptance

  • dump-ast unchanged; no measurable parse-time regression.
  • A test walks the AST of every file in src/ and checks every node range lies inside its parent range.

Design: docs/superpowers/specs/2026-10-25-lsp-foundation-design.md (Phase 1).

Activity

  1. added
    enhancement
    needs-design
    on Oct 25, 2026
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

    enhancementneeds-design

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions