Skip to content

Commit

Permalink
"save_script_lines" was renamed to "keep_script_lines"
Browse files Browse the repository at this point in the history
  • Loading branch information
mame committed Aug 20, 2021
1 parent 7a8f0b4 commit 8038c3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ test.rb:2:in `extract_value': undefined method `[]' for nil:NilClass (NoMethodEr
*Note: This API is experimental, may change in future.*

You can use the `ErrorHighlight.spot` method to get the spnippet data.
Note that the argument must be a RubyVM::AbstractSyntaxTree::Node object that is created with `save_script_lines: true` option (which is available since Ruby 3.1).
Note that the argument must be a RubyVM::AbstractSyntaxTree::Node object that is created with `keep_script_lines: true` option (which is available since Ruby 3.1).

```ruby
class Dummy
def test(_dummy_arg)
node = RubyVM::AbstractSyntaxTree.of(caller_locations.first, save_script_lines: true)
node = RubyVM::AbstractSyntaxTree.of(caller_locations.first, keep_script_lines: true)
ErrorHighlight.spot(node)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/error_highlight/core_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def to_s

loc = locs.first
begin
node = RubyVM::AbstractSyntaxTree.of(loc, save_script_lines: true)
node = RubyVM::AbstractSyntaxTree.of(loc, keep_script_lines: true)
opts = {}

case self
Expand Down

0 comments on commit 8038c3d

Please sign in to comment.