Project

General

Profile

Actions

Feature #8751

open

Add offsets to method#source_location

Added by tenderlovemaking (Aaron Patterson) over 10 years ago. Updated over 2 years ago.

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

Description

Hello,

I would like to have byte offsets returned on the source_location for methods. For example:

def foo(&b)
b.source_location # => [file_name, line_number, start_byte, end_byte]
end

If we had the start and end byte for a method or proc, then we could find the source for methods and procs in each file. There are some cases (like with heredocuments) where the "end of the method" could be after the end keyword. But I think if we just have offsets for the start of def and the end of end, I think it would cover 99% of usecases.


Related issues 1 (1 open0 closed)

Related to Ruby master - Feature #6012: Proc#source_location also return the columnAssignednobu (Nobuyoshi Nakada)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0