From: "schneems (Richard Schneeman)" Date: 2021-09-17T21:51:09+00:00 Subject: [ruby-core:105331] [Ruby master Feature#18159] Integrate functionality of dead_end gem into Ruby Issue #18159 has been updated by schneems (Richard Schneeman). > We want to make sure there's no (or very low) overhead for correct programs. So possibly load dead_end code only when the error occurs, because it's not needed otherwise. Hooking into SyntaxError#message should make it zero overhead when there are no errors. > What happens when indenting is not correct? Dead_end is most valuable to beginners, but beginners often have problems with correct indenting. (Well, if dead_end (indirectly) helps them improving their indents, then that would be good, too.) The code doesn't require perfect indentation. I'm testing against several bad indentation cases intentionally https://github.com/zombocom/dead_end/blob/15d0b93f684e8ac2fabb4affb092349d3392c0d9/spec/unit/code_search_spec.rb#L260-L337. If indentation is correct it will have a higher chance of providing better output. If it's incorrect it still should produce a decent result (within reason). This is possible because the process is lexically aware. > The best time to introduce the gem would be once the 3.1 release branch is forked from the master branch. That would be in January next year, or possibly somewhat earlier. Then we would have a lot of time for gaining experience. Sounds good > The name dead_end may be somewhat confusing for the release version. But maybe it wouldn't actually appear in the error messages. We can keep the name out of the error messages for sure. ---------------------------------------- Feature #18159: Integrate functionality of dead_end gem into Ruby https://bugs.ruby-lang.org/issues/18159#change-93746 * Author: duerst (Martin D�rst) * Status: Open * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: 3.1 ---------------------------------------- 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: