Skip to content
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

Fix inherit doc warnings #13199

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

pikinier20
Copy link
Contributor

closes #13068

@@ -79,7 +79,7 @@ class CommentExpander {
case None =>
// SI-8210 - The warning would be false negative when this symbol is a setter
if (ownComment.indexOf("@inheritdoc") != -1 && ! sym.isSetter)
println(s"${sym.span}: the comment for ${sym} contains @inheritdoc, but no parent comment is available to inherit from.")
report.warning(s"${sym.span}: the comment for ${sym} contains @inheritdoc, but no parent comment is available to inherit from.", sym.srcPos)
Copy link
Contributor

@griggt griggt Jul 29, 2021

Choose a reason for hiding this comment

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

Is it still useful to include ${sym.span} in the message now that report.warning is used with sym.srcPos? The message may be confusing to the user who may not understand what those numbers mean?

 -- Warning: scaladoc-testcases/src/tests/inheritDoc.scala:6:6 ------------------
6 |  def f: Unit = { }
  |      ^
  |<76..76>: the comment for method f contains @inheritdoc, but no parent comment is available to inherit from.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You may be right. I didn't change the message, just the way it's sent, but probably we should remove span there.

@pikinier20 pikinier20 force-pushed the scaladoc/inherit-doc-warning branch from f27ba98 to a77f23e Compare July 29, 2021 09:12
@pikinier20 pikinier20 merged commit d627128 into scala:master Jul 29, 2021
@Kordyjan Kordyjan added this to the 3.1.0 milestone Aug 2, 2023
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 omits file name from @inheritDoc warning, does not "count" warning
4 participants