Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Language Server Protocol Syntax Highlighting
Language Server Protocol Syntax Highlighting [message #1796598] Tue, 16 October 2018 12:15 Go to next message
Mehmetcan Sinir is currently offline Mehmetcan SinirFriend
Messages: 55
Registered: September 2018
Member
I am building a VS-Code Plugin based on this Project Setup:

https://github.com/itemis/xtext-languageserver-example

Although language server protocol supports syntax highlighting, it seems in VS-Code Extension, I need to create a json File, and explicitly state all keywords that I want the IDE to highlight.

However , I have many keywords and I would like out of the box highlighting for all the keywords defined in my Xtext Grammar?

Is there something I can do on the server side, for example in my IDE Project to achieve this?

Thanks
Re: Language Server Protocol Syntax Highlighting [message #1796600 is a reply to message #1796598] Tue, 16 October 2018 12:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
No you have to implement whatever your client offers for that (eg Textmaterial grammar)

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Tue, 16 October 2018 12:20]

Report message to a moderator

Re: Language Server Protocol Syntax Highlighting [message #1796602 is a reply to message #1796600] Tue, 16 October 2018 12:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
You may make use of GrammarUtil.getAllKeywords
In a Java Main

Call standalonesetup
Ask injector for grammaraccess
Ask grammar access for grammar
Call until

You may evenwrite a own fragment and add it to the workflow


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Language Server Protocol Syntax Highlighting [message #1796624 is a reply to message #1796602] Tue, 16 October 2018 14:53 Go to previous message
Mehmetcan Sinir is currently offline Mehmetcan SinirFriend
Messages: 55
Registered: September 2018
Member
@Christian Thanks I will try that!

[Updated on: Tue, 16 October 2018 14:53]

Report message to a moderator

Previous Topic:class can not be resolved to type
Next Topic:How to implement the type validation test for my grammar
Goto Forum:
  


Current Time: Fri Apr 26 00:23:55 GMT 2024

Powered by FUDForum. Page generated in 0.03467 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top