-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
RDocToYard overwrites previously defined YARD objects, even if they aren't defined in RDoc #473
Comments
Some more feedback: I can see that
So the YardMap (and by extension ApiMap) does know that the Rails classes exist, but it's not getting that ActiveRecord::Relation includes Enumerable and so should have all of its instance methods. However it does know about all of the methods on Array:
Something weird going on that |
I see that Array might not be a good comparison option, maybe it doesn't include Enumerable? Instead I looked at
Perhaps I am missing something because this is even fewer pins than for Also it seems like several tests in
... including some that reference
|
I was able to get results for
That's with Rails 6.0.3.6, Solargraph 0.43.0, and Ruby 2.7.1. Based on your failing specs, you might need to run The issue you found with It's also possible that you have a separate |
Running It fixed some of the tests I mentioned, but I still have these failures:
Perhaps that's related to the separate I am running: ⚡ solargraph -v I'll try a Rails 6.0 app later in case that's an important difference. |
I installed a fresh Rails 6.0 install with solargraph
just being a littler clearer on my installation steps:
Do you have anything else that I'm missing? Oh and the Book model isn't really important here, I'm just using |
Over on the rails thread, this comment: #87 (comment) helped me figure this out. Solargraph bundle is doing something to interfere:
Compared to the first two without
and after doing the latter, from the Rails console:
So the next question is what |
Update: I can see in RdocToYard that when SG generates YARD from RDoc for a gem it does:
Obviously this means we lose anything that was documented in YARD but not in RDoc. I'm wondering if it's possible to capture the existing YARD objects just before this, and add any objects that are not defined by the RDoc translation back into what SG saves. |
Thanks for staying on top of this. Capturing existing YARD objects seems feasible. I'll try a couple experiments and see how it looks. Any other suggestions or feedback you have is appreciated. |
Some more untangling: After a After a |
I tried a naive approach to saving all the YARD that didn't seem to improve things:
Something must be clearing out the YARD::Registry after this, or saving it to the wrong place? |
EDIT: this issue is quite far from where it started, look here for the latest.
====
[
api_map.get_complex_type_methods
returns empty forActiveRecord::Associations::CollectionProxy<MyModel>
:I expect at least the methods described here: https://api.rubyonrails.org/classes/ActiveRecord/Associations/CollectionProxy.html like
.any
,.first
etc.compared to the same thing with an Array of MyType:
Steps to reproduce:
The text was updated successfully, but these errors were encountered: