@@ -19,7 +19,6 @@ import reporting.ProperDefinitionNotFound
1919 * @author Felix Mulder
2020 */
2121 class CommentExpander {
22- // import dotc.config.Printers.dottydoc
2322 import scala .collection .mutable
2423
2524 def expand (sym : Symbol , site : Symbol )(using Context ): String = {
@@ -193,8 +192,8 @@ import reporting.ProperDefinitionNotFound
193192 val sectionTextBounds = extractSectionText(parent, section)
194193 cleanupSectionText(parent.substring(sectionTextBounds._1, sectionTextBounds._2))
195194 case None =>
196- // dottydoc. println(s"""${sym.span}: the """" + getSectionHeader + "\" annotation of the " + sym +
197- // " comment contains @inheritdoc, but the corresponding section in the parent is not defined.")
195+ println(s """ ${sym.span}: the " """ + getSectionHeader + " \" annotation of the " + sym +
196+ " comment contains @inheritdoc, but the corresponding section in the parent is not defined." )
198197 " <invalid inheritdoc annotation>"
199198 }
200199
@@ -257,8 +256,6 @@ import reporting.ProperDefinitionNotFound
257256 }
258257 case " " => idx += 1
259258 case vname =>
260- val res =
261- // println(s"CommentExpander: looking up `$vname` at `$site`")
262259 lookupVariable(vname, site) match {
263260 case Some (replacement) => replaceWith(replacement)
264261 case None => ;
@@ -290,7 +287,6 @@ import reporting.ProperDefinitionNotFound
290287 }
291288 } map {
292289 case (key, Trim (value)) =>
293-
294290 variableName(key) -> value.replaceAll(" \\ s+\\ *+$" , " " )
295291 }
296292 }
@@ -375,11 +371,10 @@ object CommentExpander {
375371 Comment (comment.span, comment.raw, Some (expandedComment), Nil , tplExp.defs(sym))
376372 }
377373 docCtx.addDocstring(sym, Some (newComment))
378- if tplExp.defs.size != 1 then
379- println(s " Unusual defs size for $sym / $owner" )
380374 newComment
381375 }
382376
377+ /** Expands comment of `sym`, but only after expanding all comments necessary to perform that. */
383378 private def expandComment (sym : Symbol )(using Context )(using docCtx : ContextDocstrings ): Option [Comment ] =
384379 if (sym eq NoSymbol ) None
385380 else docCtx.docstring(sym) match
0 commit comments