From 638b4c3f5b5721b68a6af97e237b4f056c2da7ed Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Thu, 26 Jun 2014 11:22:04 +0200 Subject: Regularize `comment` hook method This is currently pretty borken, but let's at least not clutter innocent interfaces with this functionality. Moved `comment` (as `signalParsedDocComment`) next to the other hook methods in `Global`. For now, it calls the old `reporter.comment` hook method. As soon as the IDE is refactored to receive comments properly, the deprecated `Reporter#comment` method can be removed. --- src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/scaladoc') diff --git a/src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala b/src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala index ccf18b76de..cbf8ff22ba 100644 --- a/src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala +++ b/src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala @@ -208,7 +208,7 @@ abstract class ScaladocSyntaxAnalyzer[G <: Global](val global: G) extends Syntax super.skipDocComment() } override def skipBlockComment(): Unit = { - inDocComment = false + inDocComment = false // ??? this means docBuffer won't receive contents of this comment??? docBuffer = new StringBuilder("/*") super.skipBlockComment() } @@ -217,9 +217,10 @@ abstract class ScaladocSyntaxAnalyzer[G <: Global](val global: G) extends Syntax def foundStarComment(start: Int, end: Int) = try { val str = docBuffer.toString val pos = Position.range(unit.source, start, start, end) - unit.comment(pos, str) - if (inDocComment) + if (inDocComment) { + signalParsedDocComment(str, pos) lastDoc = DocComment(str, pos) + } true } finally { docBuffer = null -- cgit v1.2.3