diff --git a/server/src/main/kotlin/org/javacs/kt/Configuration.kt b/server/src/main/kotlin/org/javacs/kt/Configuration.kt index 13774c38e..1880987d3 100644 --- a/server/src/main/kotlin/org/javacs/kt/Configuration.kt +++ b/server/src/main/kotlin/org/javacs/kt/Configuration.kt @@ -17,6 +17,11 @@ public data class SnippetsConfiguration( var enabled: Boolean = true ) +public data class CodegenConfiguration( + /** Whether to enable code generation to a temporary build directory for Java interoperability. */ + var enabled: Boolean = true +) + public data class CompletionConfiguration( val snippets: SnippetsConfiguration = SnippetsConfiguration() ) @@ -100,6 +105,7 @@ class GsonPathConverter : JsonDeserializer { } public data class Configuration( + val codegen: CodegenConfiguration = CodegenConfiguration(), val compiler: CompilerConfiguration = CompilerConfiguration(), val completion: CompletionConfiguration = CompletionConfiguration(), val diagnostics: DiagnosticsConfiguration = DiagnosticsConfiguration(), diff --git a/server/src/main/kotlin/org/javacs/kt/KotlinWorkspaceService.kt b/server/src/main/kotlin/org/javacs/kt/KotlinWorkspaceService.kt index 82ec771bd..de5afdfa0 100644 --- a/server/src/main/kotlin/org/javacs/kt/KotlinWorkspaceService.kt +++ b/server/src/main/kotlin/org/javacs/kt/KotlinWorkspaceService.kt @@ -159,6 +159,12 @@ class KotlinWorkspaceService( sf.updateExclusions() } + // Update code generation options + get("codegen")?.asJsonObject?.apply { + val codegen = config.codegen + get("enabled")?.asBoolean?.let { codegen.enabled = it } + } + // Update code-completion options get("completion")?.asJsonObject?.apply { val completion = config.completion