lib/rbi/loc.rb in rbi-0.1.0 vs lib/rbi/loc.rb in rbi-0.1.1
- old
+ new
@@ -13,11 +13,11 @@
new(
file: file,
begin_line: yarp_location.start_line,
end_line: yarp_location.end_line,
begin_column: yarp_location.start_column,
- end_column: yarp_location.end_column + 1, # TODO: Why is this off by one?
+ end_column: yarp_location.end_column,
)
end
end
sig { returns(T.nilable(String)) }
@@ -43,10 +43,14 @@
@end_column = end_column
end
sig { returns(String) }
def to_s
- "#{file}:#{begin_line}:#{begin_column}-#{end_line}:#{end_column}"
+ if end_line && end_column
+ "#{file}:#{begin_line}:#{begin_column}-#{end_line}:#{end_column}"
+ else
+ "#{file}:#{begin_line}:#{begin_column}"
+ end
end
sig { returns(T.nilable(String)) }
def source
file = self.file