Extract interface from CompilerMessageLocation to ease extension
The CompilerMessageLocation is an implicit part of the binary daemon protocol so changing it breaks compatibility with older daemons. This change allows to extend location for non-daemon uses without breaking the binary protocol.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.jsr223
|
||||
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSourceLocation
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
||||
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
||||
import org.jetbrains.kotlin.cli.common.repl.*
|
||||
@@ -92,7 +92,7 @@ class KotlinJsr223JvmScriptEngine4Idea(
|
||||
private class MyMessageCollector : MessageCollector {
|
||||
private var hasErrors: Boolean = false
|
||||
|
||||
override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageLocation?) {
|
||||
override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageSourceLocation?) {
|
||||
System.err.println(message) // TODO: proper location printing
|
||||
if (!hasErrors) {
|
||||
hasErrors = severity == CompilerMessageSeverity.EXCEPTION || severity == CompilerMessageSeverity.ERROR
|
||||
|
||||
Reference in New Issue
Block a user