Skip to content

Commit 8ba2d7a

Browse files
committed
Scala3doc: cleanup comments about cooking
1 parent a806c30 commit 8ba2d7a

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

scala3doc/src/dotty/dokka/tasty/ScalaDocSupport.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ trait ScaladocSupport { self: TastyParser =>
2020
import dotty.tools.dotc
2121
given ctx as dotc.core.Contexts.Context = qctx.asInstanceOf[scala.quoted.runtime.impl.QuotesImpl].ctx
2222

23-
// println(s"Expanding comment for sym: ${tree.symbol.show}")
2423
val sym = tree.symbol.asInstanceOf[dotc.core.Symbols.Symbol]
2524

2625
comments.CommentExpander.cookComment(sym)(using ctx)

scala3doc/src/dotty/dokka/tasty/comments/CommentExpander.scala

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

scala3doc/src/dotty/dokka/tasty/comments/wiki/Converter.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,20 @@ class Converter(val repr: Repr) extends BaseConverter {
115115

116116
case Superscript(i) =>
117117
def name = inl.getClass.getSimpleName
118-
println(s"WARN: Wiki syntax tag not yet fully supported: $name")
118+
// println(s"WARN: Wiki syntax tag not yet fully supported: $name")
119119
emitInline(i)
120120

121121
case Subscript(i) =>
122122
def name = inl.getClass.getSimpleName
123-
println(s"WARN: Wiki syntax tag not yet fully supported: $name")
123+
// println(s"WARN: Wiki syntax tag not yet fully supported: $name")
124124
emitInline(i)
125125

126126
case HtmlTag(content) =>
127127
emit(dkkd.Html(List(dkk.text(content)).asJava, kt.emptyMap))
128128

129129
case _: RepresentationLink =>
130130
val name = inl.getClass.getSimpleName
131-
println(s"WARN: Wiki syntax tag not yet supported: $name")
131+
// println(s"WARN: Wiki syntax tag not yet supported: $name")
132132
emit(dkk.text(name))
133133
}
134134

0 commit comments

Comments
 (0)