Use MPS Concepts in IntelliJ Idea Java source files (Inline MPS?) Follow
Hi,
I am successfully creating IntelliJ IDEA plugins which I am able to load and use as described in the documentation[1].
This works great - however I am wondering how to allow a user to use my concepts within their normal java source files (similar to [2]). Think of it as some sort of inline DSL. All my efforts end up in me creating a MPS model within my project which works but is not what I am looking for...
Is there any way to allow this? Cheers!
[1] https://confluence.jetbrains.com/display/MPSD20172/Using+MPS+inside+IntelliJ+IDEA
[2] https://mps-support.jetbrains.com/hc/en-us/community/posts/205827189-Embeddable-MPS
Please sign in to leave a comment.
Hi!
Because MPS editor is not text editor, you can't directly use your DSL in java source files.
But there several ways, that probably can suit you:
Probably you can mix this approaches, for example: use baseLanguage classes instead of java source classes, where you want to use DSL and then use such baseLanguage classes in other java sources directly.
One more suggestion: you can use per-root persistence for baseLanguage classes to mix java sources with MPS roots in one package: https://mps-support.jetbrains.com/hc/en-us/community/posts/207189985-Using-mps-file-per-root-in-intellij