JetBrains / kotlin-compiler-server

Server for executing kotlin code
Apache License 2.0
240 stars 73 forks source link

Is it possible to add compiler plugins to the server? #715

Open RaphaelTarita opened 8 months ago

RaphaelTarita commented 8 months ago

As far as it is documented in the README file, I haven't found a way to add compiler plugins to the served compiler (similarly to adding dependencies). For example, if I want the compiler to support kotlinx-serialization, I can include the dependency like this:

dependencies {
    kotlinDependency("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2")
    // ...
}

but that's not enough because kotlinx-serialization needs the kotlin("plugin.serialization") compiler plugin as well.

I would assume that the plugins block of this project is not the correct location to add this plugin, since it would only be applied to the gradle project itself and not to the compiler that is served when the server is started.

Is such functionality currently implemented? If yes, how can I configure it? If no, are there plans to support compiler plugins?

nikpachoo commented 7 months ago

Hi @RaphaelTarita! I attempted to add kotlinx.serialization support some time ago but failed.(#540) We still want to add the support to kotlinx. serialization, and we're planning to try once again.