summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-07-25 18:05:15 +0200
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-07-25 18:05:15 +0200
commite6c13fe8dd403d8adfc1b63cf2a2d9422f167b10 (patch)
tree5a6f3999dc4767c9db5adc3bb121ac78f278fd6c /src/compiler
parent42899b1850fd56c5e4d75d9d4c3f7509abf54d6d (diff)
parent68b16a0992877b4ebbb7c967804edbb72c05ceb5 (diff)
downloadscala-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-xsrc/compiler/scala/tools/nsc/ast/DocComments.scala9
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)