Skip to content

Commit 489ce80

Browse files
committed
Add a note about the current limitation of ErrorHighlight.spot
1 parent 6edf0a0 commit 489ce80

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/error_highlight/base.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ module ErrorHighlight
2222
# snippet: String,
2323
# script_lines: [String],
2424
# } | nil
25+
#
26+
# Limitations:
27+
#
28+
# Currently, ErrorHighlight.spot only supports a single-line code fragment.
29+
# Therefore, if the return value is not nil, first_lineno and last_lineno will have
30+
# the same value. If the relevant code fragment spans multiple lines
31+
# (e.g., Array#[] of +ary[(newline)expr(newline)]+), the method will return nil.
32+
# This restriction may be removed in the future.
2533
def self.spot(obj, **opts)
2634
case obj
2735
when Exception

0 commit comments

Comments
 (0)