Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix method line number #580

Merged
merged 2 commits into from
Jan 13, 2018
Merged

Fix method line number #580

merged 2 commits into from
Jan 13, 2018

Conversation

aycabta
Copy link
Member

@aycabta aycabta commented Jan 2, 2018

RDoc::Encoding.read_file removes magic comments, after that, Ruby parser processes the content. So method line number is reduced by the amount of the magic comment lines.

This commit fixes it by that changes the behavior of RDoc::Encoding.read_file to not remove magic comments.

This closes #425.

...But please wait for merging, this branch outputs strange documents. I'll add some commits to this branch later.

RDoc::Encoding.read_file removes magic comments, after that, Ruby parser
processes the content. So method line number is reduced by the amount of
the magic comment lines.

This commit fixes it by that changes the behavior of
RDoc::Encoding.read_file to not remove magic comments.

This closes ruby#425.
This commit removes magic comments from documents and keeps correct line
number.
@aycabta aycabta force-pushed the fix-method-line-no branch from 972fe7f to 8b3b256 Compare January 10, 2018 17:02
@aycabta
Copy link
Member Author

aycabta commented Jan 10, 2018

I added 8b3b256, it removes magic comments from documents and keeps correct line number. I checked all CRuby documents between with this branch and without this branch. There are only fixed line numbers differences (you can check it by my check tool).

@aycabta aycabta merged commit 7f66f34 into ruby:master Jan 13, 2018
@aycabta aycabta deleted the fix-method-line-no branch January 13, 2018 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Line numbers are wrong if magic comments are used
1 participant