Skip to content

Scaladoc tool: render @deprecated correctly even when named arguments weren't used #21925

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

Merged
merged 1 commit into from
Mar 10, 2025

Conversation

HarrisL2
Copy link
Contributor

Fixes #20118

Still need a test case for this issue using jsoup

@SethTisue SethTisue marked this pull request as draft November 11, 2024 17:49
@SethTisue SethTisue self-assigned this Nov 11, 2024
@SethTisue
Copy link
Member

SethTisue commented Nov 11, 2024

I'm busy at the Lightbend company meeting the whole rest of the week, then I have some vacation days, so the earliest I could return to it is around Nov 21. @HarrisL2 feel free to run with it if you like. if you end up not having time either, I'll come back to it eventually

@SethTisue SethTisue changed the title Fix scaladoc deprecation message Scaladoc tool: render @deprecated correctly even when named arguments weren't used Nov 11, 2024
@SethTisue SethTisue added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Nov 11, 2024
@HarrisL2
Copy link
Contributor Author

I'm not able to write a test case for this change without making really specific checks. Ideally it would be a general test framework like SignatureTest.scala, where we can check the generated attributes of each member with an expected result. I don't think this framework exists at the moment.

There are test cases about annotations, but those are for annotations that affect the generated signature, whereas the @deprecated annotation is a special case that is added to the attribute section, which is not tested for.

I have added test cases to scaladoc-testcases/src/tests/deprecated.scala, but it should be noted that it currently does not check the behavior of annotations. It only checks signatures through Deprecated in TranslatableSignaturesTestCases.scala.

@SethTisue SethTisue force-pushed the 20118 branch 2 times, most recently from cdea6b8 to 61dc746 Compare March 4, 2025 03:10
@SethTisue SethTisue requested a review from KacperFKorban March 4, 2025 03:14
@SethTisue SethTisue assigned KacperFKorban and unassigned SethTisue Mar 4, 2025
@SethTisue
Copy link
Member

SethTisue commented Mar 4, 2025

I hope this PR will be considered mergeable even though our ambition level stopped short of proper automated testing for it. A JSoup-based test would be annoying fragile, I think.

I've rebased it and marked it ready for review.

@KacperFKorban I'm not sure if you're currently available for reviewing this sort of PR; let me know if you think we should try to find a different reviewer.

@SethTisue SethTisue marked this pull request as ready for review March 4, 2025 03:17
Copy link
Member

@KacperFKorban KacperFKorban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, it looks good overall!
I wouldn't stress about adding tests for annotations, you would have to implement the whole infrastructure for it as well 😅
I added a small style related suggestion.

@KacperFKorban KacperFKorban merged commit 120f305 into scala:main Mar 10, 2025
29 checks passed
@WojciechMazur WojciechMazur added this to the 3.7.0 milestone Mar 11, 2025
@WojciechMazur WojciechMazur removed the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Apr 7, 2025
tgodzik pushed a commit to scala/scala3-lts that referenced this pull request Apr 24, 2025
…ts weren't used (scala#21925)

Fixes scala#20118

Still need a test case for this issue using jsoup
[Cherry-picked 120f305]
tgodzik pushed a commit to scala/scala3-lts that referenced this pull request Apr 24, 2025
…ts weren't used (scala#21925)

Fixes scala#20118

Still need a test case for this issue using jsoup
[Cherry-picked 120f305]
tgodzik pushed a commit to scala/scala3-lts that referenced this pull request Apr 25, 2025
…ts weren't used (scala#21925)

Fixes scala#20118

Still need a test case for this issue using jsoup
[Cherry-picked 120f305]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scaladoc does not show deprecation message
4 participants