class Prism::NodeFind::RubyVMBacktraceLocationFind
Finds the AST node for a Thread::Backtrace::Location using the node_id from the backtrace location.
Finds the AST node for a Thread::Backtrace::Location using the node_id from the backtrace location.
Public Instance Methods
(Thread::Backtrace::Location location) → Node?
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/node_find.rb, line 113 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.
Find the node for the given backtrace location using node_id.
: (Thread::Backtrace::Location location) -> Node?