From: "rubyFeedback (robert heiler) via ruby-core" Date: 2023-02-20T16:05:07+00:00 Subject: [ruby-core:112514] [Ruby master Feature#19452] `Thread::Backtrace::Location` should have column information if possible. Issue #19452 has been updated by rubyFeedback (robert heiler). Perhaps this could be discussed as "one item" in an upcoming dev meeting, e. g. the extensions ioquatix suggested in the last some issues raised here. Since I love introspection I am all in favour of what can be useful for us, when writing ruby code, and wanting to get more useful information. (Note that I have not thought through if I may need this, or not; I am trusting that ioquatix is convinced it may be useful. I have had very little exposure to Threads actually, and none at all with Threads::Backtrace, so to me this is a bit more of a niche topic. Guess I have to update my ruby knowledge with zverok's new documentation. :D) ---------------------------------------- Feature #19452: `Thread::Backtrace::Location` should have column information if possible. https://bugs.ruby-lang.org/issues/19452#change-101959 * Author: ioquatix (Samuel Williams) * Status: Open * Priority: Normal ---------------------------------------- I discussed this with @mame and it would be pretty useful if we could also get the column information from exception backtrace location, even if it was slow. A POC: ```ruby class Thread::Backtrace::Location if defined?(RubyVM::AbstractSyntaxTree) def first_column RubyVM::AbstractSyntaxTree.of(self, keep_script_lines: true).first_column end else def first_column raise NotImplementedError end end end ``` It would be good to have a standard interface, so we follow the same interface as https://bugs.ruby-lang.org/issues/19451 and vice versa where it makes sense. I'll investigate it. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/