instance method
ErrorHighlight::Spotter#prism_spot_call_operator_write_for_name
prism_spot_call_operator_write_for_name
lib/error_highlight/base.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/error_highlight/base.rb, line 821
def prism_spot_call_operator_write_for_name
if !@name.start_with?(/[[:alpha:]_]/)
prism_location(@node.binary_operator_loc.chop)
else
location = @node.message_loc
if @node.call_operator_loc.start_line == location.start_line
location = @node.call_operator_loc.join(location)
end
location = location.adjoin("=") if @name.end_with?("=")
prism_location(location)
end
end
Example:
x.foo += 42
^^^ (for foo)
x.foo += 42
^ (for +)
x.foo += 42
^^^^^^^ (for foo=)