-
Notifications
You must be signed in to change notification settings - Fork 3.1k
SI-9620: add doc annotation to hide specific conversions #4952
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
SI-9620: add doc annotation to hide specific conversions #4952
Conversation
130b5e7
to
1076700
Compare
All right - updated with your input @VladUreche |
Thanks for the quick update Felix and sorry for my belated answers. Thinking more about this, I'm not sure it will eliminate the At the moment, I guess your previous PR which amended the hardcoded object masks this problem. But I expect once you remove the hardcoding, you will see the duplicate methods in search again. So, the way I think this should work is to prune the implicit conversions directly in |
Damnit, you're right! Regarding pruning in So IMO there are two options:
WDYT? |
Yes, both solutions do the trick. Though I'm more in favor of the |
All right - then I'll go for # 1 👍 |
1076700
to
0fbee29
Compare
At first I thought I couldn't get the comment from the This should be along the lines of what you intended for the implementation @VladUreche |
0fbee29
to
a25817e
Compare
Pulled changes from upstream into my branch - once it's been through Jenkins it should be good to go. |
@felixmulder great! Can you please add a test case on this? |
Maybe a good think to test is that adding this annotation to |
I've added the test and I'll look at Array now. Will ping you once I know that everything's working 😄 |
👍 |
Ok - so this is where I'm at. I've added the annotation to the Array class. Removed the hardcoded ignores from the It generates the Array documentation without the implicits, huzzah! 🎉 HOWEVER! I can't get my stupid test to work 😢 |
// Assert Boo only has one implicit conversion | ||
val boo = rootPackage._package("a")._trait("Boo") | ||
val conversions = boo._conversions("a.Boo.BooShouldNotAppearIsFoo") ++ boo._conversions("a.Boo.BooLongIsFoo") | ||
assert(conversions.length == 1, conversions.length + " == 1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VladUreche: the length here is 0 for some reason. I also checked boo.conversions.length
which is 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's probably the fact that -implicits
is not set in the scaladoc flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, most likely. Here's a test for implicits:
https://github.com/scala/scala/blob/2.12.x/test/scaladoc/run/implicits-known-type-classes.scala#L11
This commit will introduce the doc annotation `@hideImplicitConversion`. By specifying which conversions to hide, the user can "toggle" which conversions are kept in the parsed entity. This implementation is a better workaround than hardcoding which ones to ignore when running scaladoc. Review: @VladUreche
b181782
to
f2e0616
Compare
@VladUreche thanks so much! It works 😄 Thanks a bunch for the help! Squished and commited! |
LGTM, thanks a lot for your tireless work @felixmulder! |
@VladUreche : Added to pending list on scala/scala-lang#394 |
…Conversions-tag SI-9620: add doc annotation to hide specific conversions
👍 |
This commit will introduce the doc annotation
@hideImplicitConversion
.By specifying which conversions to hide, the user can "toggle" which
conversions are shown be default.
This implementation is a better workaround than hardcoding which ones to
ignore when running scaladoc.
An example of how to use this:
Review: @VladUreche