Skip to content

Old pony 5304#172

Merged
IgorDeepakM merged 4 commits into
masterfrom
old_pony_5304
May 6, 2026
Merged

Old pony 5304#172
IgorDeepakM merged 4 commits into
masterfrom
old_pony_5304

Conversation

@IgorDeepakM
Copy link
Copy Markdown
Owner

No description provided.

orien added 4 commits May 6, 2026 13:11
… and ref cursor (#5304)

Add type hierarchy tests for actor, primitive, struct, interface, and ref cursor

Fixtures and integration tests covering the four entity kinds previously
untested by typeHierarchy: interface (kind=11), struct (kind=23), actor
(kind=5), and primitive (kind=5). Removing any of these tokens from
_is_entity or _symbol_kind now breaks a test.

Also adds a prepare test with the cursor on a type reference inside a
method parameter, verifying the common user interaction of navigating from
a usage site rather than a declaration.
Fix ASTSourceSpan: cap end column to actual source line length

Synthesized constructors (inserted by ponyc for entities with explicit
members) and desugared value expressions (e.g. None => None) can produce
end_pos() values that exceed the actual number of characters on the line.
These out-of-bounds columns are invalid LSP positions and confuse editors.

After the visitor accumulates _max, read the source line via
source_contents() and cap _max.column() to the line's character count.
This makes all ranges return only positions that exist in the file,
regardless of which AST transformation produced the overshoot.

Update test assertions in call hierarchy, type hierarchy, definition,
type_definition, document_symbol, and workspace_symbol tests to reflect
the now-correct line-bounded positions.
Suppress hover when the cursor lands on a capability keyword
(iso/trn/ref/val/box/tag) in any position: receiver cap on methods,
default cap on entity definitions, cap on nominal types in fields,
parameters, return types, local variables, and type parameter constraints.

_refine_node navigates cap keyword nodes to their parent (method or type
node), so the existing declaration-keyword suppression check didn't fire.
The fix scans the refined node's children for any cap keyword whose
3-character span covers the cursor position and suppresses hover there.

Adds a new _cap_keyword.pony fixture covering all syntactic positions
where a cap keyword can appear, with test assertions across all 30 cap
keyword occurrences found in the hover fixture files.
@IgorDeepakM IgorDeepakM merged commit b29ddd7 into master May 6, 2026
3 of 4 checks passed
@IgorDeepakM IgorDeepakM deleted the old_pony_5304 branch May 12, 2026 20:01
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