Closed kddnewton closed 1 month ago
@soutaro I think error_highlight does something similar to what you need with Prism: https://github.com/ruby/ruby/blob/eef2121cf3e755cdf33538647d40993d296f9a04/lib/error_highlight/base.rb#L58-L65
Like RubyVM::AST.of, it's re-parsing then finding a node.
@XrXr Got it! Thank you very much.
@soutaro basically exactly what Alan said. This method https://github.com/ruby/ruby/blob/eef2121cf3e755cdf33538647d40993d296f9a04/lib/error_highlight/base.rb#L86-L95 does effectively the same thing.
Hi @kddnewton!
Does it mean getting an AST from method at runtime is not supported in prism? Or we can do equivalent using other API? Right now or in the future?