Skip to content

Commit 4dc5220

Browse files
committed
Review changes
1 parent 7f274eb commit 4dc5220

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

project/Build.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,7 @@ object Build {
12671267
scalaSrcLink(stdLibVersion, srcManaged(dottyNonBootstrappedVersion, "scala") + "="),
12681268
dottySrcLink(referenceVersion, srcManaged(dottyNonBootstrappedVersion, "dotty") + "=", "#library/src"),
12691269
dottySrcLink(referenceVersion),
1270-
) ++ scalacOptionsDocSettings ++ revision ++ params ++ targets ++ Seq("-generate-inkuire")
1270+
) ++ scalacOptionsDocSettings ++ revision ++ params ++ targets ++ Seq("-Ygenerate-inkuire")
12711271
import _root_.scala.sys.process._
12721272
val escapedCmd = cmd.map(arg => if(arg.contains(" ")) s""""$arg"""" else arg)
12731273
Def.task {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class InkuireJSSearchEngine {
2727
)
2828
}
2929

30-
def query(s: String)(callback: PageEntry => Node)(endCallback: String => Node): List[PageEntry] = {
30+
def query(s: String)(callback: PageEntry => Unit)(endCallback: String => Unit): List[PageEntry] = {
3131
worker.onmessage = _ => ()
3232
val res = ListBuffer[PageEntry]()
3333
val func = (msg: MessageEvent) => {

scaladoc/resources/dotty_res/scripts/inkuire.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Inkuire is a Hoogle-like search engine for Scala 3 (and Kotlin).
44

55
# Usage
66

7-
To include Inkuire in scaladoc one should add `-generate-inkuire` flag. This will allow the usage of Inkuire for generated Scaladoc with project sources and available sources from external-mappings.
7+
To include Inkuire in scaladoc one should add `-Ygenerate-inkuire` flag. This will allow the usage of Inkuire for generated Scaladoc with project sources and available sources from external-mappings.
88

99
The Inkuire worker works in Scaladoc searchbar. It is triggered once an input containing `=>` is detected in searchbar. There is 1s debounce on searches with Inkuire.
1010

1111
## Generated Files
1212

13-
When including `-generate-inkuire` flag database for project sources and a config should be generated. Which are namely files: `inkuire-db.json` and `scripts/inkuire-config.json`. Config file includes addresses of possible inkuire-db files. There always is at least one - generated one. But also links for external mappings are addes on relative path `../inkuire-db.json`.
13+
When including `-Ygenerate-inkuire` flag database for project sources and a config should be generated. Which are namely files: `inkuire-db.json` and `scripts/inkuire-config.json`. Config file includes addresses of possible inkuire-db files. There always is at least one - generated one. But also links for external mappings are addes on relative path `../inkuire-db.json`.
1414

1515
`inkuire-db.json` contains a json with Inkuire engine's representation of:
1616
- types (or rather classes and objects for now)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ object Inkuire {
88
var db = InkuireDb(Seq.empty, Map.empty, Seq.empty)
99

1010
def generateInkuireConfig(externalMappings: Seq[String]): String = {
11-
val paths = ("../inkuire-db.json" +: externalMappings.map(_ + "../inkuire-db.json")).map(p => "\"" + p + "\"")
12-
s"""{"inkuirePaths": [${paths.mkString(",")}]}"""
11+
val paths = ("../inkuire-db.json" +: externalMappings.map(_ + "../inkuire-db.json")).map(jsonString)
12+
jsonObject(("inkuirePaths", jsonList(paths))).toString
1313
}
1414

1515
case class InkuireDb(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class ScaladocSettings extends SettingGroup with AllScalaSettings:
112112
BooleanSetting("-Ysnippet-compiler-debug", snippets.SnippetCompilerArgs.debugUsage, false)
113113

114114
val generateInkuire: Setting[Boolean] =
115-
BooleanSetting("-generate-inkuire", "Generates InkuireDB and enables Hoogle-like searches", false)
115+
BooleanSetting("-Ygenerate-inkuire", "Generates InkuireDB and enables Hoogle-like searches", false)
116116

117117
def scaladocSpecificSettings: Set[Setting[_]] =
118118
Set(sourceLinks, syntax, revision, externalDocumentationMappings, socialLinks, skipById, skipByRegex, deprecatedSkipPackages, docRootContent, snippetCompiler, snippetCompilerDebug, generateInkuire)

0 commit comments

Comments
 (0)