From: "Eregon (Benoit Daloze) via ruby-core" Date: 2024-09-27T15:06:08+00:00 Subject: [ruby-core:119320] [Ruby master Feature#6012] Proc#source_location also return the column Issue #6012 has been updated by Eregon (Benoit Daloze). It seems good to revisit this, the workarounds are pretty messy and CRuby-specific, e.g. https://github.com/rails/rails/pull/53055/files I think @mame 's suggestion in https://bugs.ruby-lang.org/issues/6012#note-12 is fine although I think it would be convenient to also expose the byte offsets (start and end): `.source_location #=> [path, start_line, start_column, start_offset, end_line, end_column, end_offset]` Then it would be really easy to "get the source code of a Proc". And of course we should do the same for Method/UnboundMethod (#8751). ---------------------------------------- Feature #6012: Proc#source_location also return the column https://bugs.ruby-lang.org/issues/6012#change-109934 * Author: rogerdpack (Roger Pack) * Status: Assigned * Assignee: nobu (Nobuyoshi Nakada) ---------------------------------------- As originally suggested in http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/42418 Suggestion/feature request: have #source_location also return the beginning column where it was defined. ["test.rb", 8, 33] Thanks! -roger- -- 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/lists/ruby-core.ml.ruby-lang.org/