Skip to content

Commit 19cdee3

Browse files
committed
Move docstring cooking to dotty
1 parent 31e4d32 commit 19cdee3

File tree

7 files changed

+437
-381
lines changed

7 files changed

+437
-381
lines changed

dottydoc/src/dotty/tools/dottydoc/core/UsecasePhase.scala

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ import model.factories._
1111
import dotty.tools.dotc.core.Symbols.Symbol
1212

1313
class UsecasePhase extends DocMiniPhase {
14-
private def defdefToDef(d: tpd.DefDef, sym: Symbol)(implicit ctx: Context) = DefImpl(
15-
sym,
16-
d.name.show.split("\\$").head, // UseCase defs get $pos appended to their names
17-
flags(d), path(d.symbol),
18-
returnType(d.tpt.tpe),
19-
typeParams(d.symbol),
20-
paramLists(d.symbol.info)
21-
)
14+
private def defdefToDef(d: tpd.DefDef, sym: Symbol)(implicit ctx: Context) = {
15+
val name = d.name.show.split("\\$").head // UseCase defs get $pos appended to their names
16+
DefImpl(
17+
sym,
18+
name,
19+
flags(d),
20+
path(d.symbol).init :+ name,
21+
returnType(d.tpt.tpe),
22+
typeParams(d.symbol),
23+
paramLists(d.symbol.info)
24+
)
25+
}
2226

2327
override def transformDef(implicit ctx: Context) = { case df: DefImpl =>
2428
ctx.docbase.docstring(df.symbol).flatMap(_.usecases.headOption.map(_.tpdCode)).map(defdefToDef(_, df.symbol)).getOrElse(df)

dottydoc/src/dotty/tools/dottydoc/model/comment/CommentExpander.scala

Lines changed: 0 additions & 344 deletions
This file was deleted.

0 commit comments

Comments
 (0)