Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let service definitions return code ranges scoped to name #162

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

riseshia
Copy link
Member

@riseshia riseshia commented Apr 29, 2024

Summary

service#definitions with method call returns full code range of def node now, which results to point def keyword.
IMO, which is not expected behavior, and it supposed to move cursor to the start of the method name. I confirmed rust analyzer, js lsp do the same thing, so proposed behavior is more friendly to end user.

Changes

DefNode's mid_code_range attr has name token loc, so just return it instead of which could be enough.
Ref:

mid_code_range = TypeProf::CodeRange.from_node(raw_node.name_loc)

or should we override code_range method of Node class? 🤔

Let jump to method name, not def keyword from method call go Def
@riseshia riseshia marked this pull request as ready for review April 29, 2024 06:29
@mame mame merged commit a491b48 into ruby:v2 Apr 29, 2024
6 checks passed
@mame
Copy link
Member

mame commented Apr 29, 2024

👏

@riseshia riseshia deleted the let-go-def-to-method-name branch April 29, 2024 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants