class Prism::NodeFind::RubyVMBacktraceLocationFind
Finds the AST node for a Thread::Backtrace::Location using the node_id from the backtrace location.
Public Instance Methods
Source
# File lib/prism/node_find.rb, line 83 def find(location) file = location.absolute_path || location.path return unless (result = parse_file(file)) return unless RubyVM::AbstractSyntaxTree.respond_to?(:node_id_for_backtrace_location) node_id = RubyVM::AbstractSyntaxTree.node_id_for_backtrace_location(location) result.value.find { |node| node.node_id == node_id } end
Find the node for the given backtrace location using node_id.