diff --git a/src/main/kotlin/com/compiler/server/compiler/components/CliUtils.kt b/src/main/kotlin/com/compiler/server/compiler/components/CliUtils.kt index 69a3f8369..8c9a397f9 100644 --- a/src/main/kotlin/com/compiler/server/compiler/components/CliUtils.kt +++ b/src/main/kotlin/com/compiler/server/compiler/components/CliUtils.kt @@ -73,7 +73,7 @@ fun CLICompiler<*>.tryCompilation(inputDirectory: Path, inputFiles: List ProjectSeveriry.ERROR STRONG_WARNING, WARNING -> ProjectSeveriry.WARNING - INFO, LOGGING, OUTPUT -> ProjectSeveriry.INFO + INFO, LOGGING, OUTPUT -> return "" } val errorFilePath = location?.path?.let(::Path)?.outputFilePathString() ?: defaultFileName diff --git a/src/main/kotlin/com/compiler/server/model/ExecutionResult.kt b/src/main/kotlin/com/compiler/server/model/ExecutionResult.kt index d8a46e6c2..9d7691206 100644 --- a/src/main/kotlin/com/compiler/server/model/ExecutionResult.kt +++ b/src/main/kotlin/com/compiler/server/model/ExecutionResult.kt @@ -60,6 +60,7 @@ abstract class TranslationResultWithJsCode( data class TranslationJSResult( override val jsCode: String? = null, override var exception: ExceptionDescriptor? = null, + @field:JsonProperty("errors") override var compilerDiagnostics: CompilerDiagnostics = CompilerDiagnostics() ) : TranslationResultWithJsCode(jsCode, compilerDiagnostics, exception) @@ -69,6 +70,7 @@ data class TranslationWasmResult( val wasm: ByteArray, val wat: String?, override var exception: ExceptionDescriptor? = null, + @field:JsonProperty("errors") override var compilerDiagnostics: CompilerDiagnostics = CompilerDiagnostics() ) : TranslationResultWithJsCode(jsCode, compilerDiagnostics, exception) @@ -76,6 +78,7 @@ data class TranslationWasmResult( class JunitExecutionResult( val testResults: Map> = emptyMap(), override var exception: ExceptionDescriptor? = null, + @field:JsonProperty("errors") override var compilerDiagnostics: CompilerDiagnostics = CompilerDiagnostics() ) : ExecutionResult(compilerDiagnostics, exception) diff --git a/src/main/kotlin/com/compiler/server/service/KotlinProjectExecutor.kt b/src/main/kotlin/com/compiler/server/service/KotlinProjectExecutor.kt index d3470d7f5..ced520536 100644 --- a/src/main/kotlin/com/compiler/server/service/KotlinProjectExecutor.kt +++ b/src/main/kotlin/com/compiler/server/service/KotlinProjectExecutor.kt @@ -63,10 +63,6 @@ class KotlinProjectExecutor( } } } - - private fun CompilerDiagnostics.withoutInfoDiagnostics() = CompilerDiagnostics( - map.mapValues { (_, l) -> l.filter { it.severity != ProjectSeveriry.INFO } }.filterValues { it.isNotEmpty() } - ) fun highlight(project: Project): CompilerDiagnostics = try { when (project.confType) { @@ -77,7 +73,7 @@ class KotlinProjectExecutor( } catch (e: Exception) { log.warn("Exception in getting highlight. Project: $project", e) CompilerDiagnostics(emptyMap()) - }.withoutInfoDiagnostics() + } fun getVersion() = version