Skip to content

Commit 7fa58fe

Browse files
committed
Rebase fixes 1
1 parent 3e5cf49 commit 7fa58fe

File tree

8 files changed

+914
-897
lines changed

8 files changed

+914
-897
lines changed

scaladoc-js/src/searchbar/SearchbarComponent.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ class SearchbarComponent(engine: SearchbarEngine, inkuireEngine: InkuireJSSearch
3838
wrapper.classList.add("scaladoc-searchbar-result")
3939
wrapper.classList.add("monospace")
4040

41+
val icon = document.createElement("span").asInstanceOf[html.Span]
42+
icon.classList.add("micon")
43+
icon.classList.add(p.kind.take(2))
44+
4145
val resultA = document.createElement("a").asInstanceOf[html.Anchor]
4246
resultA.href = p.location
4347
resultA.text = s"${p.fullName}"
@@ -97,12 +101,17 @@ class SearchbarComponent(engine: SearchbarEngine, inkuireEngine: InkuireJSSearch
97101
resultsDiv.scrollTop = 0
98102
while (resultsDiv.hasChildNodes()) resultsDiv.removeChild(resultsDiv.lastChild)
99103
val fragment = document.createDocumentFragment()
104+
println(s"Searching query: $query")
100105
parser.parse(query) match {
101106
case EngineMatchersQuery(matchers) =>
107+
println(s"Searching normal query: $query")
102108
handleNewFluffQuery(matchers)
103109
case BySignature(signature) =>
110+
println(s"Searching inkuire query: $query")
104111
timeoutHandle = setTimeout(1.second) {
112+
println("Timeout activated")
105113
inkuireEngine.query(query) { (p: PageEntry) =>
114+
println(s"Found ${p.fullName}")
106115
resultsDiv.appendChild(p.toHTMLInkuireHack)
107116
} { (s: String) =>
108117
resultsDiv.appendChild(s.toHTMLError)

scaladoc-js/src/searchbar/engine/InkuireJSSearchEngine.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ import scala.scalajs.js.URIUtils
1313

1414
class InkuireJSSearchEngine {
1515

16-
val scriptPath = Globals.pathToRoot + "scripts/"
17-
val worker = new Worker(s"${scriptPath}inkuire-worker.js")
16+
val scriptPath = Globals.pathToRoot + "scripts/"
17+
val worker: Worker = new Worker(scriptPath + "inkuire-worker.js")
1818

1919
def dynamicToPageEntry(d: Dynamic): PageEntry = {
2020
PageEntry(
2121
d.functionName.asInstanceOf[String],
2222
d.prettifiedSignature.asInstanceOf[String],
2323
d.pageLocation.asInstanceOf[String],
2424
d.functionName.asInstanceOf[String],
25+
"def",
2526
List.empty
2627
)
2728
}

scaladoc/resources/dotty_res/scripts/inkuire.js

Lines changed: 884 additions & 883 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scaladoc/src/dotty/tools/scaladoc/Inkuire.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ object Inkuire {
4646
isUnresolved: Boolean = false
4747
)
4848

49+
object Type {
50+
def unresolved: Type =
51+
Type(
52+
name = TypeName("<unresolved>"),
53+
itid = Some(
54+
ITID(
55+
uuid = "<unresolved>",
56+
isParsed = false
57+
)
58+
)
59+
)
60+
}
61+
4962
case class TypeName(name: String) {
5063
override def hashCode(): Int = name.toLowerCase.hashCode
5164

scaladoc/src/dotty/tools/scaladoc/ScaladocSettings.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ class ScaladocSettings extends SettingGroup with AllScalaSettings:
111111
val snippetCompilerDebug: Setting[Boolean] =
112112
BooleanSetting("-Ysnippet-compiler-debug", snippets.SnippetCompilerArgs.debugUsage, false)
113113

114-
def scaladocSpecificSettings: Set[Setting[_]] =
115-
Set(sourceLinks, syntax, revision, externalDocumentationMappings, socialLinks, skipById, skipByRegex, deprecatedSkipPackages, docRootContent, snippetCompiler, snippetCompilerDebug)
116-
117114
val generateInkuire: Setting[Boolean] =
118115
BooleanSetting("-generate-inkuire", "Generates InkuireDB", false)
116+
117+
def scaladocSpecificSettings: Set[Setting[_]] =
118+
Set(sourceLinks, syntax, revision, externalDocumentationMappings, socialLinks, skipById, skipByRegex, deprecatedSkipPackages, docRootContent, snippetCompiler, snippetCompilerDebug, generateInkuire)

scaladoc/src/dotty/tools/scaladoc/renderers/Resources.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ trait Resources(using ctx: DocContext) extends Locations, Writer:
8080
"scripts/searchbar.js",
8181
"scripts/inkuire.js",
8282
"scripts/inkuire-worker.js",
83-
"scripts/inkuire-config.json",
84-
"scripts/db.json"
83+
"scripts/inkuire-config.json"
8584
).map(dottyRes)
8685

8786
val urls = List(

scaladoc/src/dotty/tools/scaladoc/tasty/ClassLikeSupport.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ trait ClassLikeSupport:
152152
uri = methodSymbol.dri.externalLink.getOrElse("")
153153
)
154154
Inkuire.db = Inkuire.db.copy(functions = Inkuire.db.functions :+ sgn)
155-
case s =>
156-
println(s"Inkuire skipping symbol $s")
157155
}
158156

159157
}

scaladoc/src/dotty/tools/scaladoc/tasty/InkuireSupport.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,7 @@ trait InkuireSupport:
148148
case TypeBounds(low, hi) =>
149149
inner(low, vars) //TODO for future
150150
case NoPrefix() =>
151-
Inkuire.Type( //TODO check <- should be handled by Singleton case, but doesn't work
152-
name = Inkuire.TypeName("_"),
153-
itid = Some(Inkuire.ITID("_", isParsed = false)),
154-
isStarProjection = true
155-
)
151+
Inkuire.Type.unresolved //TODO check <- should be handled by Singleton case, but doesn't work
156152
case MatchType(bond, sc, cases) =>
157153
inner(sc, vars)
158154
case ParamRef(TypeLambda(names, _, resType), i) =>

0 commit comments

Comments
 (0)