Skip to content

Preserve opening-delimiter spans for unclosed syntax #362

Open

Description

@LunaStev

Tracked by #346.

Problem

Unclosed function blocks, parameter lists, grouped expressions, array literals, and struct literals commonly reach EOF and are reported at the start of the containing function. The diagnostic should retain the opening delimiter that needs a match.

Scope

Start with one shared delimiter diagnostic path and cover at least:

  • An unclosed function or nested block {.
  • An unclosed parameter or call list (.
  • An unclosed array literal [.

The diagnostic should identify the unmatched opening token and state which closing token was expected.

Completion criteria

  • The primary or related span identifies the unmatched opening delimiter.
  • The expected closing delimiter is explicit.
  • Nested delimiters report the innermost unmatched opening token.
  • Human and JSON diagnostics remain consistent.
  • Valid nested delimiters continue to parse.

Activity

  1. added
    enhancement
    good first issue
    needs testing
    on Aug 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

    enhancementgood first issueneeds testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions