banister / method_source

return the sourcecode for a method
MIT License
361 stars 43 forks source link

method_source doesn't work with Prism #82

Open eregon opened 7 months ago

eregon commented 7 months ago

Because https://github.com/banister/method_source/blob/06f21c66380c64ff05c8031c0208eef240da0e83/lib/method_source/code_helpers.rb#L125-L131 and Prism uses different SyntaxError messages.

I wonder, does method_source need to filter SyntaxError messages or could it just keep adding inputs until no more SyntaxError (or EOF)?

Ref: https://github.com/ruby/prism/issues/2734