diff --git a/kotato/src/main/kotlin/com/github/angrypotato/kotato/Parser.kt b/kotato/src/main/kotlin/com/github/angrypotato/kotato/Parser.kt index 6de4a9e..bd324f2 100644 --- a/kotato/src/main/kotlin/com/github/angrypotato/kotato/Parser.kt +++ b/kotato/src/main/kotlin/com/github/angrypotato/kotato/Parser.kt @@ -1,5 +1,8 @@ package com.github.angrypotato.kotato +import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys +import org.jetbrains.kotlin.cli.common.messages.MessageRenderer +import org.jetbrains.kotlin.cli.common.messages.PrintingMessageCollector import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment import org.jetbrains.kotlin.com.intellij.openapi.util.Disposer @@ -13,9 +16,14 @@ import org.jetbrains.kotlin.psi.psiUtil.collectDescendantsOfType open class Parser(val converter: Converter = Converter) { protected val proj by lazy { + val configuration = CompilerConfiguration() + configuration.put( + CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, + PrintingMessageCollector(System.err, MessageRenderer.PLAIN_FULL_PATHS, false) + ) KotlinCoreEnvironment.createForProduction( Disposer.newDisposable(), - CompilerConfiguration(), + configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES ).project } @@ -40,4 +48,4 @@ open class Parser(val converter: Converter = Converter) { System.setProperty("idea.use.native.fs.for.win", "false") } } -} \ No newline at end of file +}