class Prism::NodeFind::LineBacktraceLocationFind - Documentation for Ruby 4.1
Description: class Prism::NodeFind::LineBacktraceLocationFind: Location using best-effort line matching. Used on non-CRuby implementations.
Keywords: ruby,class,Prism::NodeFind::LineBacktraceLocationFind

🔍

No recent searches

# class Prism::NodeFind::LineBacktraceLocationFind

Finds the AST node for a `Thread::Backtrace::Location` using best-effort line matching. Used on non-CRuby implementations.

### Public Instance Methods

find (location)
Source

    # File lib/prism/node_find.rb, line 176
    def find(location)
      file = location.absolute_path || location.path
      return unless (result = parse_file(file))

      start_line = location.lineno
      result.value.find { |node| node.location.start_line == start_line }
    end

`Find` the node for the given backtrace location by matching on line.