aboutsummaryrefslogtreecommitdiff
path: root/dottydoc/jvm/src/dotty/tools/dottydoc
diff options
context:
space:
mode:
Diffstat (limited to 'dottydoc/jvm/src/dotty/tools/dottydoc')
-rw-r--r--dottydoc/jvm/src/dotty/tools/dottydoc/core/TypeLinkingPhases.scala4
-rw-r--r--dottydoc/jvm/src/dotty/tools/dottydoc/model/json.scala7
-rw-r--r--dottydoc/jvm/src/dotty/tools/dottydoc/util/mutate.scala2
3 files changed, 9 insertions, 4 deletions
diff --git a/dottydoc/jvm/src/dotty/tools/dottydoc/core/TypeLinkingPhases.scala b/dottydoc/jvm/src/dotty/tools/dottydoc/core/TypeLinkingPhases.scala
index 08898f3b1..0cf0923f3 100644
--- a/dottydoc/jvm/src/dotty/tools/dottydoc/core/TypeLinkingPhases.scala
+++ b/dottydoc/jvm/src/dotty/tools/dottydoc/core/TypeLinkingPhases.scala
@@ -29,9 +29,9 @@ class LinkReturnTypes extends DocMiniPhase with TypeLinker {
class LinkParamListTypes extends DocMiniPhase with TypeLinker {
override def transformDef(implicit ctx: Context) = { case df: DefImpl =>
val newParamLists = for {
- list <- df.paramLists
+ ParamListImpl(list, isImplicit) <- df.paramLists
newList = list.map(linkReference(df, _, ctx.base.packages[Package].toMap))
- } yield newList.asInstanceOf[List[NamedReference]]
+ } yield ParamListImpl(newList.asInstanceOf[List[NamedReference]], isImplicit)
df.copy(paramLists = newParamLists)
}
diff --git a/dottydoc/jvm/src/dotty/tools/dottydoc/model/json.scala b/dottydoc/jvm/src/dotty/tools/dottydoc/model/json.scala
index 44129e9d8..ea9658b5d 100644
--- a/dottydoc/jvm/src/dotty/tools/dottydoc/model/json.scala
+++ b/dottydoc/jvm/src/dotty/tools/dottydoc/model/json.scala
@@ -39,6 +39,11 @@ object json {
}
}
+ implicit class ParamListJson(val plist: ParamList) extends AnyVal {
+ def json: String =
+ s"""{"list":${plist.list.map(_.json).mkString("[",",","]")},"isImplicit":${plist.isImplicit.json}}"""
+ }
+
private def refToJson(ref: Reference): String = ref match {
case ref: TypeReference =>
s"""{"title":${ref.title.json},"tpeLink":${ref.tpeLink.json},"paramLinks":${ref.paramLinks.map(_.json).mkString("[",",","]")},"kind":"TypeReference"}"""
@@ -71,7 +76,7 @@ object json {
case ent: Object =>
s"""{"name":${ent.name.json},"members":${ent.members.map(_.json).mkString("[",",","]")},"modifiers":${ent.modifiers.map(_.json).mkString("[",",","]")},"path":${ent.path.map(_.json).mkString("[",",","]")},"superTypes":${ent.superTypes.map(_.json).mkString("[",",","]")},${ent.comment.map(_.json).fold("")(cmt => s""""comment":$cmt,""")}"kind":"object"}"""
case ent: Def =>
- s"""{"name":${ent.name.json},"modifiers":${ent.modifiers.map(_.json).mkString("[",",","]")},"path":${ent.path.map(_.json).mkString("[",",","]")},"returnValue":${ent.returnValue.json},"typeParams":${ent.typeParams.map(_.json).mkString("[",",","]")},"paramLists":${ent.paramLists.map{ xs =>xs.map(_.json).mkString("[",",","]")}.mkString("[",",","]")},${ent.comment.map(_.json).fold("")(cmt => s""""comment":$cmt,""")}"kind":"def"}"""
+ s"""{"name":${ent.name.json},"modifiers":${ent.modifiers.map(_.json).mkString("[",",","]")},"path":${ent.path.map(_.json).mkString("[",",","]")},"returnValue":${ent.returnValue.json},"typeParams":${ent.typeParams.map(_.json).mkString("[",",","]")},"paramLists":${ent.paramLists.map(_.json).mkString("[",",","]")},${ent.comment.map(_.json).fold("")(cmt => s""""comment":$cmt,""")}"kind":"def"}"""
case ent: Val =>
s"""{"name":${ent.name.json},"modifiers":${ent.modifiers.map(_.json).mkString("[",",","]")},"path":${ent.path.map(_.json).mkString("[",",","]")},"returnValue":${ent.returnValue.json},${ent.comment.map(_.json).fold("")(cmt => s""""comment":$cmt,""")}"kind":"val"}"""
}
diff --git a/dottydoc/jvm/src/dotty/tools/dottydoc/util/mutate.scala b/dottydoc/jvm/src/dotty/tools/dottydoc/util/mutate.scala
index 4ce94459d..84e3beb5b 100644
--- a/dottydoc/jvm/src/dotty/tools/dottydoc/util/mutate.scala
+++ b/dottydoc/jvm/src/dotty/tools/dottydoc/util/mutate.scala
@@ -24,7 +24,7 @@ object setters {
case _ => ()
}
- def setParamLists(ent: Entity, refs: List[List[NamedReference]]) = ent match {
+ def setParamLists(ent: Entity, refs: List[ParamList]) = ent match {
case x: DefImpl => x.paramLists = refs
case _ => ()
}