summaryrefslogtreecommitdiff
path: root/lib/error_highlight
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/error_highlight] Identify which node in `Foo::Bar::Baz` causes a NameErrorYusuke Endoh2023-01-131-0/+31
| | | | | | | | | | | | | In Ruby 3.2 or later, a nested constant access like `Foo::Bar::Baz` is compiled to one instruction by the optimization https://github.com/ruby/ruby/pull/6187 We try to spot which sub-node caues a NameError in question based on the constant name. We will give up if the same constant name is accessed in a nested access (`Foo::Foo`). Fixes https://github.com/ruby/error_highlight/pull/31 https://github.com/ruby/error_highlight/commit/0a4db7da0a
* [ruby/error_highlight] Bump versionYusuke Endoh2022-11-141-1/+1
| | | | https://github.com/ruby/error_highlight/commit/5275078dc6
* [ruby/error_highlight] Enable ErrorHighlight for TypeError/ArgumentError ↵Yusuke Endoh2022-11-141-2/+7
| | | | | | | | | only after Ruby 3.2 ... because changing TypeError#message and ArgumentError#message is highly incompatible. https://github.com/ruby/error_highlight/commit/39aa897c7a
* [ruby/error_highlight] Bump versionYusuke Endoh2022-11-081-1/+1
| | | | https://github.com/ruby/error_highlight/commit/59c291cce1
* [ruby/error_highlight] Support nodes in `spot`eileencodes2022-10-311-2/+1
| | | | | | | | | | | | | | | Fixes a bug where `spot` was using the wrong local variable. We want to use error highlight with code that has been eval'd, specifically ERB templates. We can recover the compiled source code of the ERB template but we need an API to pass the node into error highlight's `spot`. Required Ruby PR: https://github.com/ruby/ruby/pull/6593 https://github.com/ruby/error_highlight/commit/0b1b650a59 Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
* [ruby/error_highlight] Apply ErrorHighlight::CoreExt to TypeError and ↵Yusuke Endoh2022-08-191-5/+2
| | | | | | ArgumentError https://github.com/ruby/error_highlight/commit/defcaf1beb
* [ruby/error_highlight] Add a note about the current limitation of ↵Yusuke Endoh2022-08-121-0/+8
| | | | | | ErrorHighlight.spot https://github.com/ruby/error_highlight/commit/489ce80a62
* [ruby/error_highlight] Bump versionYusuke Endoh2022-08-101-1/+1
| | | | https://github.com/ruby/error_highlight/commit/6edf0a0a5d
* [ruby/error_highlight] Make backtrace_location keyword workYusuke Endoh2022-08-101-1/+3
| | | | | | We had to keep backtrace_location before opts is overwritten. https://github.com/ruby/error_highlight/commit/2735e4681a
* [ruby/error_highlight] Make ErrorHighlight.spot accept Exception ↵Yusuke Endoh2022-08-102-37/+54
| | | | | | | | | (https://github.com/ruby/error_highlight/pull/25) ... and move things from core_ext.rb to base.rb. This will confine CRuby-dependent things to ErrorHighlight.spot. https://github.com/ruby/error_highlight/commit/22d1dd7824
* [ruby/error_highlight] Use Exception#detailed_message instead of overriding ↵Yusuke Endoh2022-06-071-14/+33
| | | | | | | | | #message (https://github.com/ruby/error_highlight/pull/24) See https://bugs.ruby-lang.org/issues/18564. Ref: https://github.com/ruby/did_you_mean/pull/177 https://github.com/ruby/error_highlight/commit/671b7c61b2
* [ruby/error_highlight] Fix the spurious TypeError.Christian Boos2022-01-041-0/+1
| | | | | | | When we have no backtrace locations, we can't have the highlight, so just return the message. https://github.com/ruby/error_highlight/commit/9f5c639494
* [ruby/error_highlight] Bump versionYusuke Endoh2021-12-231-1/+1
| | | | https://github.com/ruby/error_highlight/commit/ae3053686f
* Manually sync ↵Yusuke Endoh2021-12-191-1/+3
| | | | https://github.com/ruby/error_highlight/commit/d2140d795ad0a06398db81739201877d431755db
* Make RubyVM::AbstractSyntaxTree.of raise for backtrace location in evalYusuke Endoh2021-12-191-1/+1
| | | | | | | | | This check is needed to fix a bug of error_highlight when NameError occurred in eval'ed code. https://github.com/ruby/error_highlight/pull/16 The same check for proc/method has been already introduced since 64ac984129a7a4645efe5ac57c168ef880b479b2.
* [ruby/error_highlight] Ignore all syscall errorsYusuke Endoh2021-11-301-1/+1
| | | | | | At least, Error::ENOTSUP may be raised on some extreme environments https://github.com/ruby/error_highlight/commit/2787983ff7
* [ruby/error_highlight] Make the formatter mechanism support RactorYusuke Endoh2021-10-271-5/+3
| | | | | | | | | | Now the formatter configuration is per Ractor. DefaultFormatter is used if not set. DefaultFormatter#message_for is now a class method to allow sub-Ractors to call the method. https://github.com/ruby/error_highlight/commit/9fbaa8ab7c
* ast.c: Rename "save_script_lines" to "keep_script_lines"Yusuke Endoh2021-08-201-1/+1
| | | | | | | ... as per ko1's preference. He is preparing to extend this feature to ISeq for his new debugger. He prefers "keep" to "save" for this wording. This API is internal and not included in any released version, so I change it in advance.
* [ruby/error_highlight] Keep it work if paren exists after receiverMasataka Pocke Kuwabara2021-07-311-10/+10
| | | | https://github.com/ruby/error_highlight/commit/b79d679bbd
* [ruby/error_highlight] Support a file that has no final newlineYusuke Endoh2021-07-131-0/+1
| | | | https://github.com/ruby/error_highlight/commit/9d671284cb
* [ruby/error_highlight] Support hard tabsYusuke Endoh2021-07-131-1/+2
| | | | | | | | | | Now, the highlight line is created by replacing non-tab characters with spaces, and keeping all hard tabs as-is. This means the highlight line has the completely same indentation as the code snippet line. Fixes #7 https://github.com/ruby/error_highlight/commit/38f20fa542
* [ruby/error_highlight] Stop showing a code snippet if it has non-ascii ↵Yusuke Endoh2021-07-121-1/+14
| | | | | | | | characters See https://github.com/ruby/error_highlight/issues/4 https://github.com/ruby/error_highlight/commit/c20efd3961
* [ruby/error_highlight] Suppress SyntaxError during RubyVM::AST.ofYusuke Endoh2021-07-021-1/+1
| | | | | | | When the original source code is erb, RubyVM::AST.of does not work well. https://github.com/rails/rails/issues/42678. https://github.com/ruby/error_highlight/commit/b1572761a6
* [ruby/error_highlight] Allow the development version (= master branch) of ↵Yusuke Endoh2021-06-301-1/+1
| | | | | | Ruby 3.1 https://github.com/ruby/error_highlight/commit/2dca1446c9
* Add the gemspec for error_highlightYusuke Endoh2021-06-301-0/+27
|
* [ruby/error_highlight] Bump versionYusuke Endoh2021-06-301-1/+1
| | | | https://github.com/ruby/error_highlight/commit/8d483c251e
* [ruby/error_highlight] Reconsider the API of ErrorHighlight.spotYusuke Endoh2021-06-302-18/+16
| | | | https://github.com/ruby/error_highlight/commit/acb2046a82
* [ruby/error_highlight] Experimentally support a custom formatterYusuke Endoh2021-06-303-28/+53
| | | | https://github.com/ruby/error_highlight/commit/f40a1de20e
* [ruby/error_highlight] Add some commentsYusuke Endoh2021-06-301-1/+5
| | | | https://github.com/ruby/error_highlight/commit/e0c90c72c3
* Rename error_squiggle to error_highlightYusuke Endoh2021-06-293-0/+497