Skip to content

Commit

Permalink
Add a note about the current limitation of ErrorHighlight.spot
Browse files Browse the repository at this point in the history
  • Loading branch information
mame committed Aug 12, 2022
1 parent 6edf0a0 commit 489ce80
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/error_highlight/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ module ErrorHighlight
# snippet: String,
# script_lines: [String],
# } | nil
#
# Limitations:
#
# Currently, ErrorHighlight.spot only supports a single-line code fragment.
# Therefore, if the return value is not nil, first_lineno and last_lineno will have
# the same value. If the relevant code fragment spans multiple lines
# (e.g., Array#[] of +ary[(newline)expr(newline)]+), the method will return nil.
# This restriction may be removed in the future.
def self.spot(obj, **opts)
case obj
when Exception
Expand Down

0 comments on commit 489ce80

Please sign in to comment.