-
Notifications
You must be signed in to change notification settings - Fork 440
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
Missing constants possibly related to mixed c/rb and nested classes #399
Comments
When an item is not in any section it ends up in the nil section. Unfortunately RDoc creates a separate Section object between grouping and display time which would cause items to disappear from a section at HTML generation time. Now that two Section objects with the same title map to the same Hash key the constants will not disappear. Fixes bug #399
Fixed! |
Any plans for a new release any time soon? |
I'll make a bug-fix release in the next day or two, thank you! |
Should this also cover refering to constants that were previously not emitted in the documentation due to this bug? Here I access the constant via irb:
If I however type Xmms::Collection::NS_ALL, defined in rb_collection.c, in the comment for a method in the file that declares Xmms::Client, rb_xmmsclient.c, I will not get a link for that constant. Nor will I if I type "Xmms::Collection::NS_ALL" in the comment of any method defined in the same file as NS_ALL. If I instead type "NS_ALL" in a comment of a method defined in the same file as NS_ALL, I will get a link, so maybe Xmms::Collection::NS_ALL is an invalid syntax in rdoc when it comes to constants? Anyways.. if I go back to refering to simply "NS_ALL" in another file rather than the same - I will not get any link. The files in question for the whole of this issue are found at: |
@dsvensson Does it work (from another file than this constant is defined) if you use the entire name like Xmms::Collection::NS_ALL? For example, only "NS_ALL" isn't linking in another file? |
No. Full namespace+constant doesn't work in any file. |
Ugh :( @dsvensson are you testing with master? |
Not really. I tried "rake package" and installd the resulting gem file (name oddly contained "borked" or somesuch). "which rdoc" points to the binary under my user's home dir. When running rdoc it seems as if it still uses parts of my system wide version so I removed the gem again and applied the patch for this issue on the system wide one (Fedora 23). This makes the constant emitting work and my docs have all the methods/constant that should be there. The linking is however broken. I run "rdoc src/clients/lib/ruby/*.{c,rb}" on the repo mentioned above and under Xmms::Client there is a doc reference to Xmms::Collection::NS_ALL that will not become a link. Does that work for you? What am I missing with my gem installation of rdoc, it would obviously be better if I used master properly. |
Hmm, you should be able to install the gem package and Ruby will pick the newest version. You could try patching the install you have, but that seems problematic. If you have a smaller reproduce, that would help! Can you reproduce it with the code you originally submitted in the issue description? |
Werid.. pulled again and now I got a |
Yep, added a
|
So after some poking, I was able to reproduce this only when trying to refer to the constant from another class. Within a different file is ok, as long as it's in the same class. Here are the files I used to reproduce: # ok.rb
module Zomg
class Wtf
# Check out Zomg::Wtf::BBQ
# or BBQ
# or maybe even ::BBQ
# it should be there, i promise!
def rly
puts "i'm a method"
end
end
end # rly.rb
class Rly
# this is another method
# perhaps we can reference Zomg::Wtf::BBQ from here?
# well
# how about at least the class? Zomg::Wtf
def asdf
end
end // zomg.c
void
Init_Zomg()
{
zomg = rb_define_module("Zomg");
wtf = rb_define_class_under(zomg, "Wtf", rb_cObject);
/* Document-const: Zomg::Wtf::BBQ
*
* zomgzomgozmg */
rb_define_const(wtf, "BBQ", Qnil);
} |
After some debugging, I was able to fix a bug when using the full constant name within the same class/context wasn't linking. I'm, however, stumped as to how to fix this for another class not in the current context.. /cc @drbrain |
Minimal test case to reproduce:
Create two files,
async.rb:
collection.c:
Build with:
rdoc async.rb collection.c
And notice the lack of the NS_ALL constant.
The text was updated successfully, but these errors were encountered: