Seeking advice about intellij plugins for Kotlin KMP that want to do something a bit odd in a custom new plugin:
• have a mixed source file that will split code out to different configurations (common, jvm, js)
• the compiler plugin or pre-processor would do the splitting for compilation (writing files into source sets for each platform)
• the IDE plugin needs to be able to have each injected language be a kotlin from a different platform for various parts of the same file.
For example, two imports might be from different dependencies on different platforms. I of course can mark them if needed to make it easy for my preprocessing, but each needs a different injected Kotlin. Other code snippets (a lambda for example) would be for one platform vs. another. I would manage building the prefix/postfix for the code injection to make sure they are valid within the context of the whole file.
I see plugins like JTE merging their language with Kotlin fragments doing this for Kotlin, but only 1 Kotlin platform. In my case I need to inject Kotlin in 3 different platforms to same file and keep their scopes/dependencies separate.
Kotlin KMP allows source sets for different platforms and dependencies as separate modules in Intellij, or at least that appears to be the only option. Is there a way to mix within the same module? And inject with that knowledge of platform?