Old pony 5304#172
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.