You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you use a magic comment, the line numbers are wrong as they treat the first non-magic comment line as line 1. This probably needs fixing in lib/rdoc/encoding.rb.
Example:
$ cat a.rb && rdoc24 a.rb > /dev/null 2>&1 && fgrep line doc/Object.html
def a; end
<pre><span class="ruby-comment"># File a.rb, line 1</span>
$ cat a2.rb && rdoc24 a2.rb > /dev/null 2>&1 && fgrep line doc/Object.html
# encoding: utf-8
def a; end
<pre><span class="ruby-comment"># File a2.rb, line 1</span>
$ cat a3.rb && rdoc24 a3.rb > /dev/null 2>&1 && fgrep line doc/Object.html
# encoding: utf-8
# frozen-string-literal: true
def a; end
<pre><span class="ruby-comment"># File a3.rb, line 1</span>
$ cat a4.rb && rdoc24 a4.rb > /dev/null 2>&1 && fgrep line doc/Object.html
# encoding: utf-8
# frozen-string-literal: true
def a; end
<pre><span class="ruby-comment"># File a4.rb, line 2</span>
The text was updated successfully, but these errors were encountered:
aycabta
added a commit
to aycabta/rdoc
that referenced
this issue
Jan 1, 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 closesruby#425.
...But please wait for merging, this branch outputs strange documents.
I'll add some commits to this branch later.
aycabta
added a commit
to aycabta/rdoc
that referenced
this issue
Jan 1, 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 closesruby#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 closesruby#425.
If you use a magic comment, the line numbers are wrong as they treat the first non-magic comment line as line 1. This probably needs fixing in
lib/rdoc/encoding.rb
.Example:
The text was updated successfully, but these errors were encountered: