Skip to content

Old pony 5241#157

Merged
IgorDeepakM merged 5 commits intomasterfrom
old_pony_5241
Apr 26, 2026
Merged

Old pony 5241#157
IgorDeepakM merged 5 commits intomasterfrom
old_pony_5241

Conversation

@IgorDeepakM
Copy link
Copy Markdown
Owner

No description provided.

orien and others added 5 commits April 25, 2026 00:22
…e/symbol` (#5241)

textDocument/documentSymbol was producing "selectionRange must be
contained in range" errors in LSP clients, causing the entire symbol
list to be rejected. The root cause was that range was set to the
declaration keyword span while selectionRange was set to the identifier
span — the identifier starts after the keyword ends.

Symbol ranges across both textDocument/documentSymbol and
workspace/symbol now cover the full declaration, from the opening
keyword to the end of the body. Previously documentSymbol ranges covered
only the keyword (class, fun, etc.) and workspaceSymbol ranges covered
only the identifier.

Two additional compiler quirks required fixes:
- ponyc synthesizes create constructors for bare primitives and classes,
  positioned at the start of the next entity in the file. These were
  inflating entity ranges into following entities' lines. Fixed by
  bounding each entity's span to the next sibling's start position and
  filtering synthesized members from the symbol tree.
- type aliases (type Foo is Bar) store the referenced type's
  definition-site position on the nominal reference node. This was
  pulling the range start up to Bar's declaration line. Fixed by
  clamping range.start to the type keyword's position.

New integration test suites cover documentSymbol containment,
exact ranges, entity kinds, member kinds, cross-file trait filtering,
type alias ranges, bare primitive ranges, and workspace/symbol ranges
across all member token types.
textDocument/definition and textDocument/typeDefinition responses now
return a range covering the full declaration — from the opening keyword
to the end of the body. Previously the range covered only the declaration
keyword (class, fun, etc.).

Range computation now also correctly handles the last type declaration in
a file. Previously the compiler's synthesized default constructors could
cause the final entity's range to extend to an incorrect position.
Reworked the return values for the exceptions. Fake reach_type_t
is no longer necessary as value pass and return value exceptions
are no longer combined. Value pass lowering cannot happen with
exceptions. Simplified the return value exceptions code because
of this.

Missed that try_return_info wasn't copied in copy_subordinate
which led to that return values, especially with tuples didn't
work
Disabled one test that includes string.pony which seems to be
taken from the builin library. This fails possibly because of
changes in string.pony compared to the old Pony project.
@IgorDeepakM IgorDeepakM merged commit 83b44e4 into master Apr 26, 2026
1 of 4 checks passed
@IgorDeepakM IgorDeepakM deleted the old_pony_5241 branch April 27, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants