Skip to content

Commit 8b3eafc

Browse files
committed
Add codegen configuration
1 parent febdf6b commit 8b3eafc

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

server/src/main/kotlin/org/javacs/kt/Configuration.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ public data class SnippetsConfiguration(
1717
var enabled: Boolean = true
1818
)
1919

20+
public data class CodegenConfiguration(
21+
/** Whether to enable code generation to a temporary build directory for Java interoperability. */
22+
var enabled: Boolean = true
23+
)
24+
2025
public data class CompletionConfiguration(
2126
val snippets: SnippetsConfiguration = SnippetsConfiguration()
2227
)
@@ -100,6 +105,7 @@ class GsonPathConverter : JsonDeserializer<Path?> {
100105
}
101106

102107
public data class Configuration(
108+
val codegen: CodegenConfiguration = CodegenConfiguration(),
103109
val compiler: CompilerConfiguration = CompilerConfiguration(),
104110
val completion: CompletionConfiguration = CompletionConfiguration(),
105111
val diagnostics: DiagnosticsConfiguration = DiagnosticsConfiguration(),

server/src/main/kotlin/org/javacs/kt/KotlinWorkspaceService.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ class KotlinWorkspaceService(
159159
sf.updateExclusions()
160160
}
161161

162+
// Update code generation options
163+
get("codegen")?.asJsonObject?.apply {
164+
val codegen = config.codegen
165+
get("enabled")?.asBoolean?.let { codegen.enabled = it }
166+
}
167+
162168
// Update code-completion options
163169
get("completion")?.asJsonObject?.apply {
164170
val completion = config.completion

0 commit comments

Comments
 (0)