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

NoMethodError: undefined method end_keyword_loc for an instance of Prism::ProgramNode #2393

Closed
andyw8 opened this issue Jul 31, 2024 · 0 comments · Fixed by #2429
Closed
Assignees
Labels
bug Something isn't working

Comments

@andyw8
Copy link
Contributor

andyw8 commented Jul 31, 2024

Our internal telemetry recorded this exception:

New handled error in production from ... in ~/.gem/ruby/3.3.1/gems/ruby-lsp-0.17.10/lib/ruby_lsp/requests/code_action_resolve.rb:171:in `refactor_method':0
Handled error
NoMethodError: undefined method `end_keyword_loc' for an instance of Prism::ProgramNode
Location
~/.gem/ruby/3.3.1/gems/ruby-lsp-0.17.10/lib/ruby_lsp/requests/code_action_resolve.rb:171:in `refactor_method':0 -

We cast closest_def = T.cast(node_context.node, Prism::DefNode) so it seems that it not always valid.

@andyw8 andyw8 added the bug Something isn't working label Jul 31, 2024
@amomchilov amomchilov changed the title NoMethodError: undefined method `end_keyword_loc' for an instance of Prism::ProgramNode NoMethodError: undefined method end_keyword_loc for an instance of Prism::ProgramNode Jul 31, 2024
@vinistock vinistock self-assigned this Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants