Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infrastructure for enso --docs option & signature generator #10291

Merged
merged 38 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6be7d9f
Cannot return CompilerContext.Module as that's not TruffleObject
JaroslavTulach Jun 15, 2024
e65eccc
isGenDocs seems to be totally unused
JaroslavTulach Jun 15, 2024
0dd3a5d
Generate documentation for a library into its docs/api folder
JaroslavTulach Jun 15, 2024
b10ae46
Avoid generating content for private modules
JaroslavTulach Jun 15, 2024
87b5026
Include also the documentation in the generated files
JaroslavTulach Jun 15, 2024
cbcb783
Merging with most recent develop
JaroslavTulach Jan 15, 2025
72c9d89
Hint usage of --in-project option when project path isn't specified
JaroslavTulach Jan 15, 2025
ea4f573
Generate documentation via visitor
JaroslavTulach Jan 15, 2025
37583e0
visitConstructor with Definition.Data
JaroslavTulach Jan 15, 2025
dabdbed
Exposing visitModule to tests
JaroslavTulach Jan 16, 2025
bd4f78a
Making runtime test compile
JaroslavTulach Jan 16, 2025
e30adaa
DocsGenerate test skeleton
JaroslavTulach Jan 16, 2025
8cf7fde
Expanding the test with methods
JaroslavTulach Jan 16, 2025
615e8ef
Keeping generateDocs flag in the ModuleContext
JaroslavTulach Jan 16, 2025
9afa696
Generate documentation for a project in the test
JaroslavTulach Jan 16, 2025
f0fe9c4
Process all method bindings for a type when processing a type
JaroslavTulach Jan 16, 2025
f233f28
Helper method to generateDocumentation in the test
JaroslavTulach Jan 16, 2025
69e648d
Extracting types from the IR and generating proper signature for a fu…
JaroslavTulach Jan 16, 2025
e78c17f
Generate signature of a constructor
JaroslavTulach Jan 16, 2025
69bb876
Exposing two standard implementations of DocsVisit interface
JaroslavTulach Jan 16, 2025
ce2194a
Skip self in case of static methods
JaroslavTulach Jan 16, 2025
40b50e9
--docs=api selects the DocsEmitSignatures generator
JaroslavTulach Jan 16, 2025
bd9001d
javafmtAll
JaroslavTulach Jan 16, 2025
124f415
Hiding private constructors and methods
JaroslavTulach Jan 17, 2025
b065fe0
Extract type from Vector Text
JaroslavTulach Jan 17, 2025
9bd0819
Support for union types
JaroslavTulach Jan 17, 2025
eba903c
Write down version of the API format to begin with
JaroslavTulach Jan 17, 2025
682ba26
Return ANY when the type isn't known
JaroslavTulach Jan 17, 2025
f7e1411
Prefix extension methods with type's FQN
JaroslavTulach Jan 17, 2025
ab8ddf7
Specify values in back ampersands
JaroslavTulach Jan 20, 2025
5dd13a7
Using Scala ternary operator
JaroslavTulach Jan 20, 2025
0d63f0a
Associate exitFail with an message. Differentiate between stdout and …
JaroslavTulach Jan 20, 2025
9bfd828
Scala doesn't have ternary operator
JaroslavTulach Jan 20, 2025
6dbc951
Removing commented out line
JaroslavTulach Jan 20, 2025
5c02828
Using PrintWriter instead of Appendable to avoid line separator issues
JaroslavTulach Jan 20, 2025
aeb9a4e
Fail on wrong format
JaroslavTulach Jan 20, 2025
42a9464
Use subdirectories when generating the .md file
JaroslavTulach Jan 20, 2025
c105fe1
scalafmtAll
JaroslavTulach Jan 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this correct? It seems that the underlying value of docsArg is a String?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was:

  • false - don't generate
  • true - generate and use default "style"
  • any String - generate and use the "style" specified by the string

)
}

}
Loading
Loading