[Intellij][Plagin][OpenApi] How to Run some file using RunContentManager

Answered

Sorry in advance, I'm newer in Plugin developing. I need to run file from Editor using my Action implementation. I found RunContentManager class, but to execute selectRunContent function, I need to init RunContentDescriptor. How can I do that? Thanks

0
6 comments

I just need to run kotlin file, which is open in Editor using RunContentManager. How can do that?

0

Please see https://plugins.jetbrains.com/docs/intellij/execution.html and use org.jetbrains.kotlin.idea.run.KotlinRunConfigurationType.Companion#getInstance for default Kotlin runner.

0

Thanks a lot! Could you please also help to investigate how to get exit code?

0

It is impossible to import org.jetbrains.kotlin.idea.run.KotlinRunConfigurationType. Should I add some imports to my plugin?

0

To use classes from Kotlin plugin, you must setup a dependency on it as described here https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html

 

0

Please sign in to leave a comment.