blob: 69bda283f00df7d534849223bf60eed660792292 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package dotty.tools.dottydoc
package js
import scala.scalajs.js
import js.Dynamic.global
import js.JSApp
import js.annotation.JSName
/** The unpickled AST available as scala classes */
object EntityIndex {
import microjson._
import prickle._
import model.Entities._
lazy val packages: Map[String, Package] =
//FIXME
//Unpickle[Map[String, Package]]
//.fromString(js.JSON.stringify(Unparsed.packages))
//.from[js.Object](Unparsed.packages)
//.toOption
None
.getOrElse(Map.empty)
val currentEntity: Entity = Unpickle[Entity]
.fromString(js.JSON.stringify(Unparsed.currentEntity))
.toOption
.get
/** Unparsed index stores the pickled AST generated by the dottydoc tool */
@js.native @JSName("UnparsedIndex") private object Unparsed extends js.Object {
def packages: js.Object = js.native
def currentEntity: js.Object = js.native
}
}
|