diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2014-07-25 18:05:15 +0200 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2014-07-25 18:05:15 +0200 |
commit | e6c13fe8dd403d8adfc1b63cf2a2d9422f167b10 (patch) | |
tree | 5a6f3999dc4767c9db5adc3bb121ac78f278fd6c /src/compiler | |
parent | 42899b1850fd56c5e4d75d9d4c3f7509abf54d6d (diff) | |
parent | 68b16a0992877b4ebbb7c967804edbb72c05ceb5 (diff) | |
download | scala-e6c13fe8dd403d8adfc1b63cf2a2d9422f167b10.tar.gz scala-e6c13fe8dd403d8adfc1b63cf2a2d9422f167b10.tar.bz2 scala-e6c13fe8dd403d8adfc1b63cf2a2d9422f167b10.zip |
Merge pull request #3881 from pocket7878/issue/6144
Update javadoc tag to new scaladoc tags.
Diffstat (limited to 'src/compiler')
-rwxr-xr-x | src/compiler/scala/tools/nsc/ast/DocComments.scala | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/DocComments.scala b/src/compiler/scala/tools/nsc/ast/DocComments.scala index 6d9b41ec45..02a199f7ac 100755 --- a/src/compiler/scala/tools/nsc/ast/DocComments.scala +++ b/src/compiler/scala/tools/nsc/ast/DocComments.scala @@ -59,14 +59,21 @@ trait DocComments { self: Global => comment.defineVariables(sym) } + + def replaceInheritDocToInheritdoc(docStr: String):String = { + docStr.replaceAll("""\{@inheritDoc\p{Zs}*\}""", "@inheritdoc") + } + /** The raw doc comment of symbol `sym`, minus usecase and define sections, augmented by * missing sections of an inherited doc comment. * If a symbol does not have a doc comment but some overridden version of it does, * the doc comment of the overridden version is copied instead. */ def cookedDocComment(sym: Symbol, docStr: String = ""): String = cookedDocComments.getOrElseUpdate(sym, { - val ownComment = if (docStr.length == 0) docComments get sym map (_.template) getOrElse "" + var ownComment = if (docStr.length == 0) docComments get sym map (_.template) getOrElse "" else DocComment(docStr).template + ownComment = replaceInheritDocToInheritdoc(ownComment) + superComment(sym) match { case None => if (ownComment.indexOf("@inheritdoc") != -1) |