Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/rubyPublic

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

Open
eregon wants to merge3 commits intoruby:master
base:master
Choose a base branch
Loading
fromeregon:source_location_byte_columns_for_4_0

Conversation

@eregon
Copy link
Member

@eregoneregon commentedDec 16, 2025
edited
Loading

Also:

  • [Bug #21783] Fix documentation of {Method,UnboundMethod,Proc}#source_location
  • [Bug #21784] Fix the Proc#source_location start_column for stabby lambdas

So this PR fixes all known issues about {Method,UnboundMethod,Proc}#source_location.

n-rodriguez reacted with thumbs up emoji
* 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
Copy link
Member

@nobunobu left a 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
Copy link
MemberAuthor

eregon commentedDec 16, 2025
edited
Loading

Good point, especially since column might imply it starts at 1.
Do you have any suggestion?
The current text in2d579f8 is:

(3) the column where the definition starts, in number of bytes from the start of the line

So maybe:

(3) the byte index where the definition starts, counted from the start of the line

(using matz's words fromhttps://bugs.ruby-lang.org/issues/21783#note-8)
or

(3) the position where the definition starts, in number of bytes from the start of the line

?
Let me know what you think is better, happy to update.

…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.
@eregoneregonforce-pushed thesource_location_byte_columns_for_4_0 branch from7ac7008 toa1c18d0CompareDecember 16, 2025 13:35
@eregon
Copy link
MemberAuthor

eregon commentedDec 16, 2025
edited
Loading

I have updated to this one for now:

(3) the position where the definition starts, in number of bytes from the start of the line

because "byte index" sounds to me rather confusing in this context.

@kddnewton
Copy link
Contributor

I'm fine with the code in here, pending approval from whomever makes the final decision.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nobunobunobu left review comments

@matzmatzAwaiting requested review from matz

@kddnewtonkddnewtonAwaiting requested review from kddnewton

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@eregon@kddnewton@nobu

[8]ページ先頭

©2009-2025 Movatter.jp