Project

General

Profile

Actions

Feature #19452

open

`Thread::Backtrace::Location` should have column information if possible.

Added by ioquatix (Samuel Williams) almost 2 years ago. Updated over 1 year ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:112505]

Description

I discussed this with @mame (Yusuke Endoh) 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:

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.


Related issues 1 (1 open0 closed)

Related to Ruby master - Feature #19451: Extract path and line number from SyntaxError?OpenActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0