ruby / error_highlight

The gem enhances Exception#message by adding a short explanation where the exception is raised
MIT License
150 stars 23 forks source link

Fix error with prism when method given no arguments #48

Closed luke-gru closed 3 weeks ago

luke-gru commented 1 month ago

such as:

p = Proc.new

This is now highlighted, and it wasn't before.

mame commented 1 month ago

@kddnewton Could you please review this change?

luke-gru commented 4 weeks ago

Okay, thanks for the review. I've made the changes you mentioned.

kddnewton commented 4 weeks ago

Sorry if I was unclear, but this appears to have gone in the opposite direction from what I said. Instead of returning nil if those conditions are met, now it tries to highlight the name. I'm saying we should keep the previous behavior for RubyVM::AbstractSyntaxTree and switch Prism to match, which would be returning nil in the case that there are no arguments.