Replies: 1 comment
-
Same question applies to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While hacking on solargraph-rails I've discovered that Solargraph has a mechanism for annotating methods as returning "the generic" from a method chain. I've used this to annotate
ActiveRecord::FinderMethods#first
in myhacks
branch. This makes it possible to write code likeUser.find(123).posts.active.where("...").first
and actually getPost
as the return type of#first
.My question is: is it likely that this capability will be removed without replacement in future Solargraph releases? In general it's really tricky to refer to generic types using YARD syntax, but I hope that this little hack stays in place as long as Solargraph is using YARD.
Beta Was this translation helpful? Give feedback.
All reactions