instance method
ErrorHighlight::Spotter#spot_colon2
spot_colon2
lib/error_highlight/base.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/error_highlight/base.rb, line 611
def spot_colon2
nd_parent, const = @node.children
if nd_parent.last_lineno == @node.last_lineno
fetch_line(nd_parent.last_lineno)
@beg_column = nd_parent.last_column
@end_column = @node.last_column
else
fetch_line(@node.last_lineno)
if @snippet[...@node.last_column].match(/#{ Regexp.quote(const) }\z/)
@beg_lineno = @end_lineno = @node.last_lineno
@beg_column = $~.begin(0)
@end_column = $~.end(0)
end
end
end
Example:
Foo::Bar ^^^^^
See also
#spot_call_for_name
#spot_defn
#spot_call_for_args
#spot_defs
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1