Skip to content

Commit

Permalink
Infrastructure for enso --docs option & signature generator (#10291)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach authored Jan 21, 2025
1 parent 17dcbd6 commit 570f141
Show file tree
Hide file tree
Showing 19 changed files with 1,287 additions and 240 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ class Module(private val value: Value) {
def evalExpression(code: String): Value =
value.invokeMember(EVAL_EXPRESSION, code)

/** Triggers generation of documentation from module sources.
*
* @return value with `GENERATE_DOCS` invoked on it.
*/
def generateDocs(): Value = {
value.invokeMember(GENERATE_DOCS)
}

/** Triggers gathering of import statements from module sources.
*
* @return value with `GATHER_IMPORT_STATEMENTS` invoked on it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,26 @@ class TopScope(private val value: Value) {
value.invokeMember(UNREGISTER_MODULE, qualifiedName): Unit
}

def compile(shouldCompileDependencies: Boolean): Unit = {
value.invokeMember(COMPILE, shouldCompileDependencies)
def compile(
shouldCompileDependencies: Boolean
): Unit = {
compile(shouldCompileDependencies, None)
}
def compile(
shouldCompileDependencies: Boolean,
generateDocs: Option[String]
): Unit = {
val docsArg = generateDocs.map {
case "api" => "api"
case "md" => "md"
case other =>
throw new IllegalStateException("Invalid docs format: " + other)
}
value.invokeMember(
COMPILE,
shouldCompileDependencies,
docsArg.getOrElse(false)
)
}

}
Loading

0 comments on commit 570f141

Please sign in to comment.