Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

ErrorHighlight.spot

spot(...)

Identify the code fragment that seems associated with a given error

Arguments:

node: RubyVM::AbstractSyntaxTree::Node (script_lines should be enabled)
point_type: :name | :args
name: The name associated with the NameError/NoMethodError

Returns:

Example
{
  first_lineno: Integer,
  first_column: Integer,
  last_lineno: Integer,
  last_column: Integer,
  snippet: String,
} | nil
See also .formatter= .formatter also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2