From: "Eregon (Benoit Daloze)" Date: 2022-06-17T14:06:52+00:00 Subject: [ruby-core:108987] [Ruby master Feature#18159] Integrate functionality of dead_end gem into Ruby Issue #18159 has been updated by Eregon (Benoit Daloze). Adding `Exception#source_contents` or `code_location` (an object exposing everything needed) or even just `source_location` would be great. TruffleRuby can implement it easily, and already has all the necessary information available. Relying on `RubyVM::AbstractSyntaxTree.of` is no good, it will only ever work on CRuby: https://bugs.ruby-lang.org/issues/18231#note-5 We've discussed this already, I think it is time to stop hacking new ways to get source lines, and add a clean method to get that, and that internally can use whatever makes sense. Note that `SyntaxError` is a bit special because it can point to two regions of code, the one with the incorrect syntax, and the one which called into parsing (e.g., `eval("...")`). ---------------------------------------- Feature #18159: Integrate functionality of dead_end gem into Ruby https://bugs.ruby-lang.org/issues/18159#change-98097 * Author: duerst (Martin D��rst) * Status: Open * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: 3.2 ---------------------------------------- Missing 'end' errors are difficult to fix. We should integrate the functionality of the dead_end gem (https://github.com/zombocom/dead_end) into Ruby similar to how we integrated did_you_mean. It would greatly help programming Ruby, in particular for beginners. See also Ruby Kaigi Takeout 2021 talk by Richard Schneeman https://rubykaigi.org/2021-takeout/presentations/schneems.html. -- https://bugs.ruby-lang.org/ Unsubscribe: