ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: samuel@oriontransfer.net
To: ruby-core@ruby-lang.org
Subject: [ruby-core:91197] [Ruby trunk Feature#6012] Proc#source_location also return the column
Date: Sun, 20 Jan 2019 22:14:58 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-76429.20190120221456.b18804f160f3812d@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-6012.20120214091730@ruby-lang.org

Issue #6012 has been updated by ioquatix (Samuel Williams).


If changing this API is too complicated due to backwards compatibility, why not introduce new more general API:

```
Method#source -> Source.new(path, line_number, line_count, code, ...)
```

Usage:

```
method.source.code
method.source.path
method.source.location -> [2, 0, 3, 3]
```

Maybe including byte offset and length would also be useful (for seek).

----------------------------------------
Feature #6012: Proc#source_location also return the column
https://bugs.ruby-lang.org/issues/6012#change-76429

* Author: rogerdpack (Roger Pack)
* Status: Assigned
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Target version: 
----------------------------------------
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/

  parent reply	other threads:[~2019-01-20 22:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14  0:17 [ruby-core:42579] [ruby-trunk - Bug #6012][Open] Proc#source_location also return the column Roger Pack
2012-02-14  0:18 ` [ruby-core:42580] [ruby-trunk - Bug #6012] " Roger Pack
2012-02-25 20:06 ` [ruby-core:42928] [ruby-trunk - Feature " Koichi Sasada
2012-02-26 14:32 ` [ruby-core:42951] " Thomas Sawyer
2012-02-26 14:33 ` [ruby-core:42952] " Thomas Sawyer
2012-02-26 20:18   ` [ruby-core:42961] " Eric Hodel
2012-02-27  0:39 ` [ruby-core:42964] " Thomas Sawyer
2012-02-27  0:40 ` [ruby-core:42965] " Thomas Sawyer
2012-10-25 12:58 ` [ruby-core:48281] " yhara (Yutaka HARA)
2018-12-28  6:05 ` [ruby-core:90769] [Ruby trunk Feature#6012] " mame
2019-01-20 22:14 ` samuel [this message]
2019-02-12  1:24 ` [ruby-core:91512] " samuel
2019-02-12  2:24 ` [ruby-core:91514] " samuel
2019-02-12  7:49 ` [ruby-core:91518] " duerst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-76429.20190120221456.b18804f160f3812d@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).