- Notifications
You must be signed in to change notification settings - Fork5.5k
Reapply "[Feature #6012] Extendsource_location for end position#15580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Conversation
* This reverts commit065c48c.* This functionality is very valuable and has already taken 14 years to agree on the API.* Let's just document it's byte columns (in the next commit).* Seehttps://bugs.ruby-lang.org/issues/21783#note-9
nobu left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think we should avoid the word “column” in the documents, because of the ambiguities.
eregon commentedDec 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Good point, especially since column might imply it starts at 1.
So maybe:
(using matz's words fromhttps://bugs.ruby-lang.org/issues/21783#note-8)
? |
…bdas* Consistent with plain `blocks` and `for` blocks and methods where the source_location covers their entire definition.* Matches the documentation which mentions "where the definition starts/ends".* Partially revertsd357d50 which was a workaround to be compatible with parse.y.
7ac7008 toa1c18d0Compareeregon commentedDec 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I have updated to this one for now:
because "byte index" sounds to me rather confusing in this context. |
kddnewton commentedDec 18, 2025
I'm fine with the code in here, pending approval from whomever makes the final decision. |
Uh oh!
There was an error while loading.Please reload this page.
to agree on the API.
Also:
So this PR fixes all known issues about {Method,UnboundMethod,Proc}#source_location.