diff options
author | schneems <richard.schneeman+foo@gmail.com> | 2022-07-26 15:16:21 -0500 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-08-19 10:02:24 +0900 |
commit | a50df1ab0eb312e5cdcf010d2c1b362ec41f3c59 (patch) | |
tree | 9e0f630b55f6202e5f81f043c68f00748f8bad78 /tool | |
parent | 3541f32951fecdfea76ef6de028d50ba58cb07b9 (diff) |
Setup SyntaxSuggest as default gem
Adds the `syntax_suggest` syntax error display tool to Ruby through the same mechanism as `error_highlight` and `did_you_mean`. Reference ticket: https://bugs.ruby-lang.org/issues/18159
close #4845
## What is syntax_suggest?
When a syntax error is raised by requiring a file, dead_end will use a combination of indentation and lexing to identify the problem.
> Note: Previously this tool was named `dead_end`.
## Known issues
- SyntaxSearch's approach of showing syntax errors only works through integration with `require`, `load`, `autoload`, and `require_relative` (since it monkeypatches them to detect syntax errors). It does not work with direct Ruby file invocations https://github.com/zombocom/dead_end/issues/31.
- This causes failure in the test suite (test_expected_backtrace_location_when_inheriting_from_basic_object_and_including_kernel) and confusion when inspecting backtraces if there's a different error when trying to require a file such as measuring memory (https://github.com/zombocom/syntax_suggest/issues/124#issuecomment-1006705016).
- Discussed fix. We previously talked about opening up `SyntaxError` to be monkeypatched in the same way that other gems hook into `NoMethodError`. This is currently not possible and requires development work. When we last talked about it at RubyKaigi Nobu expressed an ability to make such a change.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5859
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/sync_default_gems.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index 78620e1508..ae3fcbce61 100755 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -73,6 +73,7 @@ REPOSITORIES = { pathname: "ruby/pathname", digest: "ruby/digest", error_highlight: "ruby/error_highlight", + syntax_suggest: "zombocom/syntax_suggest", un: "ruby/un", win32ole: "ruby/win32ole", } |