JetBrains / MPS-extensions

MPS-extensions aims to ease language development within MPS.
https://jetbrains.github.io/MPS-extensions/
Apache License 2.0
80 stars 47 forks source link

Cannot build language as plugin when using QueryList #846

Closed digital-ember closed 2 weeks ago

digital-ember commented 1 month ago

I'm trying to create a language plugin for my language using MPS build lang. It used to work, but now my language uses a QueryList. I can build the language in MPS just fine. But when I run my build script, I get the follwoing error messages:

...\editor\SubflowHolder_EditorBuilder_a.java:130: error: QueryListHandler_4f0dwp_b0 is not abstract and does not override abstract method deleteNode(SNode,SNode) in QueryListHandler
    [javac]   private static class QueryListHandler_4f0dwp_b0 extends QueryListHandler {
    [javac]                  ^
    [javac] ...\editor\SubflowHolder_EditorBuilder_a.java:190: error: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] ...\editor\SubflowHolder_EditorBuilder_a.java:193: error: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] ...\editor\SubflowHolder_EditorBuilder_a.java:351: error: QueryListHandler_4f0dwp_d0 is not abstract and does not override abstract method deleteNode(SNode,SNode) in QueryListHandler
    [javac]   private static class QueryListHandler_4f0dwp_d0 extends QueryListHandler {
    [javac]                  ^
    [javac] ...\editor\SubflowHolder_EditorBuilder_a.java:411: error: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] ...\editor\SubflowHolder_EditorBuilder_a.java:414: error: method does not override or implement a method from a supertype
    [javac]     @Override
    [javac]     ^

Any idea what might be missing here?

alexanderpann commented 1 month ago

I made a change to the query list handler class, so you probably just have to run a clean build. If this is not the case, I'll take a look at it.

digital-ember commented 2 weeks ago

Hi Alexander, back from vacation, I can verify this was fixed by a clean build (I deleted all generated sources and tmp artifacts from my filesystem before running the "Rebuild solution" action on my build solution).

digital-ember commented 2 weeks ago

Okay, my bad: I deleted the generated sources of my target language as well when I tested the idea of a "clean build". When I do that, my build script runs without error, but I assume it still pulls old information from somewhere (not sure where, to be honest). But anyway, when I rebuild my target language module, I get the same errors again when I try to build my RCP with my build scripts. So I must assume something is still off with the Querylist in the mps-extensions I am using.

digital-ember commented 2 weeks ago

In fact, running the build script without having build my language before, it does create a source-gen folder in my language as part of the build process, but it doesn't deploy my language as a plugin. While I see it in the modules pool when I open a sandbox project with the RCP, it claims that the concepts of my language cannot be found, so I assume some compiled sources are just not there.

digital-ember commented 2 weeks ago

Further investigations show that the methods it complains about are :

    @Override
    public void insertNewNode(final SNode node, final SNode anchorNode, final boolean insertBefore, final EditorContext editorContext) {
    }
    @Override
    public void deleteNode(final SNode node, final SNode nodeToDelete, final EditorContext editorContext) {
    }

I don't understand Java well enough to know why it doesn't recognize that these are overridden from QueryListHandler.

digital-ember commented 2 weeks ago

Okay, @sergej-koscejev helped me find my error: my build script was pointing at the wrong mps-extensions :)

alexanderpann commented 2 weeks ago

For anybody else running into similar issues in the future: whenever you see a compilation error where a method doesn't match, it means you are mixing MPS versions, use wrong platform versions, didn't regenerate your models or there is indeed a bug. Hopefully we catch such compilation errors with our tests.