@@ -19,7 +19,6 @@ import reporting.ProperDefinitionNotFound
19
19
* @author Felix Mulder
20
20
*/
21
21
class CommentExpander {
22
- // import dotc.config.Printers.dottydoc
23
22
import scala .collection .mutable
24
23
25
24
def expand (sym : Symbol , site : Symbol )(using Context ): String = {
@@ -193,8 +192,8 @@ import reporting.ProperDefinitionNotFound
193
192
val sectionTextBounds = extractSectionText(parent, section)
194
193
cleanupSectionText(parent.substring(sectionTextBounds._1, sectionTextBounds._2))
195
194
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." )
198
197
" <invalid inheritdoc annotation>"
199
198
}
200
199
@@ -257,8 +256,6 @@ import reporting.ProperDefinitionNotFound
257
256
}
258
257
case " " => idx += 1
259
258
case vname =>
260
- val res =
261
- // println(s"CommentExpander: looking up `$vname` at `$site`")
262
259
lookupVariable(vname, site) match {
263
260
case Some (replacement) => replaceWith(replacement)
264
261
case None => ;
@@ -290,7 +287,6 @@ import reporting.ProperDefinitionNotFound
290
287
}
291
288
} map {
292
289
case (key, Trim (value)) =>
293
-
294
290
variableName(key) -> value.replaceAll(" \\ s+\\ *+$" , " " )
295
291
}
296
292
}
@@ -375,11 +371,10 @@ object CommentExpander {
375
371
Comment (comment.span, comment.raw, Some (expandedComment), Nil , tplExp.defs(sym))
376
372
}
377
373
docCtx.addDocstring(sym, Some (newComment))
378
- if tplExp.defs.size != 1 then
379
- println(s " Unusual defs size for $sym / $owner" )
380
374
newComment
381
375
}
382
376
377
+ /** Expands comment of `sym`, but only after expanding all comments necessary to perform that. */
383
378
private def expandComment (sym : Symbol )(using Context )(using docCtx : ContextDocstrings ): Option [Comment ] =
384
379
if (sym eq NoSymbol ) None
385
380
else docCtx.docstring(sym) match
0 commit comments