Skip to content

Fix hover on method parameters with inline RBS annotations#369

Open
whtsht wants to merge 3 commits intoruby:masterfrom
whtsht:inline-hover
Open

Fix hover on method parameters with inline RBS annotations#369
whtsht wants to merge 3 commits intoruby:masterfrom
whtsht:inline-hover

Conversation

@whtsht
Copy link

@whtsht whtsht commented Feb 16, 2026

There was an issue where hovering was not possible when method arguments had rbs comments.

The root cause was an off-by-one error: Prism::Location#start_line is 1-based, but rbs_comments is indexed by 0-based line numbers.
As a result, the first element of rbs_comments ended up being nil, e.g.:

[nil, " (Integer) -> void"]

whtsht@0e6baab

This PR fixes the issue by subtracting 1 from start_line before indexing/storing into rbs_comments.

@whtsht
Copy link
Author

whtsht commented Feb 16, 2026

screenshot :)

before
image

after
image

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.

1 participant