Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[che-dev] Adding Syntax Highlighting to Xtext DSL [Language Server] in Eclipse Che

I have created a language server for a simple 'Hello World' DSL using Xtext with the following grammar: -

grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals

generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"

Model:
    greetings+=Greeting*;

Greeting:
    'Hello' name=ID '!';

When I create it as an Eclipse plugin and run as an Eclipse Application, everything works fine; syntax highlighting, auto completion works fine. However, when I create it as a Gradle build with Fat Jar, and implement the Fat jar into Eclipse Che as a sidecar (by pushing a dockerfile with the fat jar embedded in it into Docker Hub), syntax highlighting does not work as expected. However, the editor understands the language. I know this because it provides auto-completion support and underlines in red when I type syntactically wrong statements.

The statements do not have a colour variation at all. It looks like a simple .txt file. Is there a possible way to include syntax highlighting to my DSL when it is running in Eclipse Che?

Thanks in advance!

SharkJ.


Back to the top