@@ -25,13 +25,14 @@ class GenerateApiReport extends SemanticRule("GenerateApiReport") {
25
25
case a : Defn .Object => process(a.mods, a.symbol, a.templ, ScopeType .Object )
26
26
case a : Defn .Trait => process(a.mods, a.symbol, a.templ, ScopeType .Trait )
27
27
case a : Pkg .Object => process(a.mods, a.symbol, a.templ, ScopeType .Object )
28
- case _ =>
28
+ case _ =>
29
29
}
30
30
31
31
Patch .empty
32
32
}
33
33
34
- private def process (parentMods : List [Mod ], sym : Symbol , body : Template , typ : ScopeType )(implicit doc : SemanticDocument ): Unit = {
34
+ private def process (parentMods : List [Mod ], sym : Symbol , body : Template , typ : ScopeType )(
35
+ implicit doc : SemanticDocument ): Unit = {
35
36
// Skip non-public scopes
36
37
val info = sym.info.get
37
38
if (! info.isPublic && ! info.isPackageObject)
@@ -41,10 +42,10 @@ class GenerateApiReport extends SemanticRule("GenerateApiReport") {
41
42
_.filter {
42
43
case Mod .Annot (Init (tpe, _, List (List (_, ver)))) if tpe.toString == " deprecated" =>
43
44
set(
44
- ver match {
45
- case Lit .String (s) => s
46
- case term => term.toString
47
- }
45
+ ver match {
46
+ case Lit .String (s) => s
47
+ case term => term.toString
48
+ }
48
49
)
49
50
false
50
51
case _ => true
@@ -54,10 +55,10 @@ class GenerateApiReport extends SemanticRule("GenerateApiReport") {
54
55
var scopeDeprecatedVer = Option .empty[String ]
55
56
inspectAnnotationsFn(v => scopeDeprecatedVer = Some (v))(parentMods)
56
57
57
- val parents = Util .parents(sym).iterator.map(Util .typeSymbol).toList
58
+ val parents = Util .parents(sym).iterator.map(Util .typeSymbol).toList
58
59
val domParents = parents.iterator.filter(isScalaJsDom).toSet
59
- val isJsType = parents.exists(isScalaJs)
60
- val s = state.register(sym, isJsType, typ, domParents, scopeDeprecatedVer)
60
+ val isJsType = parents.exists(isScalaJs)
61
+ val s = state.register(sym, isJsType, typ, domParents, scopeDeprecatedVer)
61
62
62
63
def letsSeeHowLazyWeCanBeLol (t : Tree ): Unit = {
63
64
// Skip non-public members
@@ -77,17 +78,17 @@ class GenerateApiReport extends SemanticRule("GenerateApiReport") {
77
78
var deprecatedVer = Option .empty[String ]
78
79
val inspectAnnotations = inspectAnnotationsFn(v => deprecatedVer = Some (v))
79
80
t2 match {
80
- case Decl .Def (mods, name, tparams, paramss, tpe) => t2 = Decl .Def (inspectAnnotations(mods), name, tparams, paramss, tpe)
81
- case Decl .Val (mods, pats, tpe) => t2 = Decl .Val (inspectAnnotations(mods), pats, tpe)
82
- case Decl .Var (mods, pats, tpe) => t2 = Decl .Var (inspectAnnotations(mods), pats, tpe)
83
- case Defn .Type (mods, names, params, tpe) => t2 = Defn .Type (inspectAnnotations(mods), names, params, tpe)
84
- case _ =>
81
+ case Decl .Def (mods, name, tparams, paramss, tpe) =>
82
+ t2 = Decl .Def (inspectAnnotations(mods), name, tparams, paramss, tpe)
83
+ case Decl .Val (mods, pats, tpe) => t2 = Decl .Val (inspectAnnotations(mods), pats, tpe)
84
+ case Decl .Var (mods, pats, tpe) => t2 = Decl .Var (inspectAnnotations(mods), pats, tpe)
85
+ case Defn .Type (mods, names, params, tpe) => t2 = Defn .Type (inspectAnnotations(mods), names, params, tpe)
86
+ case _ =>
85
87
}
86
88
87
89
// Generate member desc
88
90
val desc =
89
- t2
90
- .toString
91
+ t2.toString
91
92
.replace('\n ' , ' ' )
92
93
.replace(" =" , " = " )
93
94
.replace(" @inline " , " " )
@@ -131,10 +132,10 @@ class GenerateApiReport extends SemanticRule("GenerateApiReport") {
131
132
}
132
133
133
134
private def saveReport (): Unit = {
134
- val scalaVer = Util .scalaSeriesVer.replace('.' , '_' )
135
+ val scalaVer = Util .scalaSeriesVer.replace('.' , '_' )
135
136
val projectRoot = System .getProperty(" user.dir" )
136
- val reportFile = Paths .get(s " $projectRoot/api-reports/ $scalaVer.txt " )
137
- val api = state.result().iterator.map(_.stripPrefix(" org/scalajs/dom/" )).mkString(" \n " )
137
+ val reportFile = Paths .get(s " $projectRoot/api-reports/ $scalaVer.txt " )
138
+ val api = state.result().iterator.map(_.stripPrefix(" org/scalajs/dom/" )).mkString(" \n " )
138
139
139
140
val content =
140
141
s """ |scala-js-dom API
0 commit comments