Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Oct 3, 2023
1 parent 5f05763 commit 3a2b778
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final case class DoctorResults(

object DoctorResults {
// Version of the Doctor json that is returned.
val version = 4
val version = 5
}

final case class DoctorFolderResults(
Expand All @@ -41,6 +41,7 @@ final case class DoctorFolderResults(
)
targets.foreach(targetList => json("targets") = targetList.map(_.toJson))
json("explanations") = explanations
json("errorReports") = errorReports.map(_.toJson)
json
}
}
Expand Down Expand Up @@ -168,4 +169,15 @@ final case class ErrorReportInfo(
uri: String,
buildTarget: Option[String],
shortSummary: String,
)
) {
def toJson: Obj = {
val json = ujson.Obj(
"name" -> name,
"timestamp" -> timestamp,
"uri" -> uri,
"shortSummary" -> shortSummary,
)
buildTarget.foreach(json("buildTarget") = _)
json
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,25 @@ trait CommonMtagsEnrichments {
s"""|range: ${r.start} - ${r.end}
|uri: ${r.uri()}
|text:
|$withMarkers""".stripMargin
|```scala
|$withMarkers
|```
|""".stripMargin
case o: OffsetParams =>
s"""|offset: ${o.offset()}
|uri: ${o.uri()}
|text:
|${textWithPosMarker(o.offset(), o.text())}""".stripMargin
|```scala
|${textWithPosMarker(o.offset(), o.text())}
|```
|""".stripMargin
case v =>
s"""|uri: ${v.uri()}
|text:
|${v.text()}""".stripMargin
|```scala
|${v.text()}
|```
|""".stripMargin
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,14 @@ class HoverProvider(val compiler: MetalsGlobal, params: OffsetParams)(implicit
|tpe: ${tree.tpe}
|
|tree:
|```scala
|$tree
|```
|
|full tree:
|```scala
|${unit.body}
|```
|""".stripMargin,
s"empty hover in $fileName",
s"$fileName::$posId"
Expand Down
14 changes: 12 additions & 2 deletions mtags/src/main/scala-3/scala/meta/internal/pc/HoverProvider.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,19 @@ object HoverProvider:
|has error: ${tpw.isError}
|
|path:
|- ${path.map(_.toString()).mkString("\n- ")}
|${path
.map(tree => s"""|```scala
|$tree
|```
|""".stripMargin)
.mkString("\n")}
|trees:
|- ${trees.map(_.toString()).mkString("\n- ")}
|${trees
.map(tree => s"""|```scala
|$tree
|```
|""".stripMargin)
.mkString("\n")}
|""".stripMargin,
s"empty hover in $uri",
s"$uri::$posId",
Expand Down

0 comments on commit 3a2b778

Please sign in to comment.