override fun onTextAvailable()

in plugin-bazel/src/main/kotlin/org/jetbrains/bazel/fastbuild/FastBuildUtils.kt [228:271]


              override fun onTextAvailable(event: ProcessEvent, outputType: Key<*>) {
                if (outputType == ProcessOutputType.STDERR) {
                  if (ECLIPSE_PROBLEM_SEPARATOR in event.text) return
                  if (JAVAC_WARNING in event.text || ECLIPSE_WARNING in event.text) {
                    isWarning = true
                  } else if (JAVAC_ERROR in event.text || ECLIPSE_ERROR in event.text) {
                    isWarning = false
                  }
                  val compilerCategory = if (isWarning) CompilerMessageCategory.WARNING else CompilerMessageCategory.ERROR

                  val parts = event.text.split(':')
                  val line = parts.firstOrNull()?.trim()?.toIntOrNull()
                  if (parts.size >= 4 && line != null) {
                    val error = parts[3]
                    compileContext.addMessage(
                      CompilerMessageImpl(
                        project,
                        compilerCategory,
                        error,
                        inputFile,
                        line,
                        0,
                        null,
                      ),
                    )
                  } else {
                    compileContext.addMessage(
                      CompilerMessageImpl(
                        project,
                        compilerCategory,
                        event.text,
                      ),
                    )
                  }
                } else if (outputType == ProcessOutputType.STDOUT) {
                  compileContext.addMessage(
                    CompilerMessageImpl(
                      project,
                      CompilerMessageCategory.INFORMATION,
                      event.text,
                    ),
                  )
                }
              }