Language server can't gradlew build success

Hi guys, When I build my language server, I got this problem:

Task :aaa0513.mydsl.ide:generateXtext FAILED
ERROR:aaa0513.mydsl.ide.server.codeActions.StatesCodeActionService cannot be resolved to a type. (file:/C:/Users/95185/theia-xtext-sprotty-aaa0513-528/language-server/aaa0513.mydsl.ide/src/main/java/aaa0513/mydsl/ide/MyDslIdeModule.xtend line : 6 column : 8)
ERROR:The method or field StatesCodeActionService is undefined (file:/C:/Users/95185/theia-xtext-sprotty-aaa0513-528/language-server/aaa0513.mydsl.ide/src/main/java/aaa0513/mydsl/ide/MyDslIdeModule.xtend line : 15 column : 3)
WARNING:The type ICodeActionService is deprecated (file:/C:/Users/95185/theia-xtext-sprotty-aaa0513-528/language-server/aaa0513.mydsl.ide/src/main/java/aaa0513/mydsl/ide/MyDslIdeModule.xtend line : 7 column : 8)
WARNING:The type ICodeActionService is deprecated (file:/C:/Users/95185/theia-xtext-sprotty-aaa0513-528/language-server/aaa0513.mydsl.ide/src/main/java/aaa0513/mydsl/ide/MyDslIdeModule.xtend line : 14 column : 22)
ERROR:missing EOF at ‘?’ ( line : 1 column : 1)

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:aaa0513.mydsl.ide:generateXtext’.

Xtext validation failed, see build log for details.

I have import all the associated jar package.
Does anyone know how to solve this problem? Thanks!

[original thread by Qizewen]

please ask here: https://github.com/eclipse/xtext-core

cc @jankoehnlein maybe you have an idea?

Looks like some syntax errors (22) and a couple of unresolved classes. Does the language server compile in your IDE?

[Qizewen]

Thanks for your reply!

The language server is compile success in eclipse.
In “MyDslIdeModule.xtend”, if I move this code

//import aaa0513.mydsl.ide.server.codeActions.StatesCodeActionService
//import org.eclipse.xtext.ide.server.codeActions.ICodeActionService2
/**

  • Use this class to register ide components.
    */
    class MyDslIdeModule extends AbstractMyDslIdeModule {
    // def Class<? extends ICodeActionService2> bindICodeActionService() {
    // StatesCodeActionService
    // }
    }

in terminal it can gradlew build success, but in theia it can’t show the diagram,it will output"No diagram service for type ‘states-diagram’"

if I add the code above
in terminal I got this problem I posted
“Task :aaa0513.mydsl.ide:generateXtext FAILED ERROR:aaa0513.mydsl.ide.server.codeActions.StatesCodeActionService cannot be resolved to a type”

I don’t see any syntax errors in eclipse. Any solutions about this problem?
Are there any dependencies not added in “build.gradle”

Are you sure you copied and extracted the language server correctly into the Theia extension?

[Qizewen]

yes, i am sure . because if i move the ActionCode and build success i can see the keywords are highlight on theia and It will also prompt for syntax errors.

Anyways, I want to use sprotty to customize a special node, like “actor” in usecase model . if there are any reference about sprotty API?

There are two aspects of a node: The SModel and the View.
Roughly, in the SModel, you put everything that is variable at runtime, while in the View you specify figures. For an Actor stickfigure you would likely implement that as a view. The most important aspect of a view is that it renders as an SVG figure. Have a look at the various subclasses of views for examples.