Creating an MPS language Idea-Plugin with Actions/KeyMaps/...

Hi,

my language has a plugin facet which defines actions, action groups, key maps, and so on. However I cannot build the language as an idea plugin because while compiling (running the build script) I get the following errors:

java.compile.DbUnitDsl:
    [mkdir] Created dir: C:\MPS-Projects\db-testdata-dsl7\build\tmp\db-testdata-dsl\java\out\DbUnitDsl
    [javac] Compiling 211 source files to C:\MPS-Projects\db-testdata-dsl7\build\tmp\db-testdata-dsl\java\out\DbUnitDsl
    [javac] C:\MPS-Projects\db-testdata-dsl7\languages\DbUnitDsl\source_gen\DbUnitDsl\plugin\DbUnitDsl_ApplicationPlugin.java:5: package jetbrains.mps.plugins.applicationplugins does not exist
    [javac] import jetbrains.mps.plugins.applicationplugins.BaseApplicationPlugin;
    [javac]   ^
    [javac] C:\MPS-Projects\db-testdata-dsl7\languages\DbUnitDsl\source_gen\DbUnitDsl\plugin\DbUnitDsl_ApplicationPlugin.java:7: cannot find symbol
    [javac] symbol  : class Tools_ActionGroup
    [javac] location: package jetbrains.mps.ide.actions
    [javac] import jetbrains.mps.ide.actions.Tools_ActionGroup;
    [javac]   ^
    [javac] C:\MPS-Projects\db-testdata-dsl7\languages\DbUnitDsl\source_gen\DbUnitDsl\plugin\DbUnitDsl_ApplicationPlugin.java:13: cannot find symbol
    [javac] symbol: class BaseApplicationPlugin
    [javac] public class DbUnitDsl_ApplicationPlugin extends BaseApplicationPlugin {
    [javac]     ^
    [javac] C:\MPS-Projects\db-testdata-dsl7\languages\DbUnitDsl\source_gen\DbUnitDsl\plugin\EntityResourceXMLWriter.java:9: warning: com.sun.org.apache.xml.internal.serialize.OutputFormat is Sun proprietary API and may be removed in a future release
    [javac] import com.sun.org.apache.xml.internal.serialize.OutputFormat;
    [javac]    ^
    [javac] C:\MPS-Projects\db-testdata-dsl7\languages\DbUnitDsl\source_gen\DbUnitDsl\plugin\EntityResourceXMLWriter.java:12: warning: com.sun.org.apache.xml.internal.serialize.XMLSerializer is Sun proprietary API and may be removed in a future release
    [javac] import com.sun.org.apache.xml.internal.serialize.XMLSerializer;

...
prettyPrint();

Is there any way to make actions, key maps etc. available for Idea?
1 comment
Comment actions Permalink
Hi, Yann,

Actions are included into IDEA differently that into MPS, so you have to write a specific IDEA integration solution for them. To use your actions in IDEA and MPS you can split your code into 3 parts:
  1. actions common for MPS and IDEA;
  2. action groups and keymaps for MPS; this solution can not be packaged in plugin for IDEA;
  3. action groups and keymaps for IDEA; only packaged into IDEA plugin.

For the latter, create IdeaActionDescriptor and add groups and keymaps there (see how it's done in a model jetbrains.ide.platform.actions, node PlatformActions). Instead of ordinary action groups, create "plugin.xml" action groups (set "register via plugin.xml: true" in action group inspector). Same for keymaps. IdeaActionDescriptor generates an xml which you can include into plugin.xml file of your idea plugin.

--
Julia
0

Please sign in to leave a comment.