"quasi-headless" Scala editor? Follow
I want to evaluate the possibility of integrating as much of the Scala plugin / code editor in my own (non-IDEA based) "IDE" or desktop application. Does the API offer a way to initialise itself without coming up with the main IntelliJ window, and so that I could create virtual files for my code (these are like "class" files if you like, with an implied import scope from the containing class path) and bring up a code editor (e.g. inside a JComponent or JFrame) for them, embedding as much as possible (e.g. parser, inspections (?)) from the Scala plug-in? Where to start?
Please sign in to leave a comment.
Yes, you can start IDEA in a headless mode, using the <appStarter> extension point and the ApplicationStarter interface. You'll need to configure the classpath of your project using IntelliJ IDEA's project model API or by loading an existing .idea directory.
Check out this plugin for an implementation of a similar approach (you may be able to simply use it as is): https://github.com/Ruin0x11/intellij-lsp-server
I see, the direct link:https://github.com/Ruin0x11/intellij-lsp-server/blob/a28f9296537a24978cb563c7835ca9b97e82422b/src/main/kotlin/com/ruin/lsp/model/LanguageServerApplicationStarter.kt#L9 - so that's a good starting point for me, thank you