I have some shared code between a Kotlin compiler ...
# compiler
r
I have some shared code between a Kotlin compiler plugin and the corresponding companion IDEA plugin. In the compiler plugin I was getting the Message Collector like this:
Copy code
val messageCollector: MessageCollector = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE)
This does not work on the IDEA side because CLIConfigurationKeys is not there. What is the proper way to obtain the MessageCollector in the IDEA plugin that does not use
CLIConfigurationKeys
? thanks!
s
I am not sure that
MessageCollector
is available in IDEA. Its package is
org.jetbrains.kotlin.cli.common.messages
which suggests it is used for CLI. If you are trying to report errors or warnings, I have noticed that compiler uses diagnostics for that. JB plugins do the same, e.g. in the serialization plugin: https://github.com/JetBrains/kotlin/blob/master/plugins/kotlin-serialization/kotlin-serialization-compiler/src/org/jetbrains/kotlinx/serialization/compiler/diagnostic/SerializationErrors.java
r
thanks!