forked from cdietrich/xtext-languageserver-example
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Christian Dietrich <[email protected]>
- Loading branch information
Showing
3 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Hello A! | ||
Hello B from A! | ||
Hello name | ||
from Other! | ||
Hello Xtext! | ||
Hello VSCode from Xtext! | ||
Hello ThisFile from Other! | ||
Hello you! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/* this is a definition in another file */ | ||
Hello Other! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,40 @@ | ||
# Xtext VS Code example | ||
|
||
This is a simple example showing the Xtext integration for VS Code based on the Microsoft Language Server Protocol. It allows you to edit `*.mydsl` files inside an opened folder. | ||
This is a simple example showing the [Xtext](https://www.eclipse.org/Xtext/) integration for VS Code based on the Microsoft [Language Server Protocol](https://github.com/Microsoft/language-server-protocol). | ||
|
||
The base is following simple grammar | ||
|
||
``` | ||
Model: | ||
greetings+=Greeting*; | ||
Greeting: | ||
'Hello' name=ID ('from' from=[Greeting])? '!'; | ||
``` | ||
|
||
A typical example model would look like (Open a new folder in VSCode and create the files) | ||
|
||
a.mydsl | ||
``` | ||
Hello Xtext! | ||
Hello VSCode from Xtext! | ||
Hello ThisFile from Other! | ||
Hello you! | ||
``` | ||
|
||
b.mydsl | ||
``` | ||
/* this is a definition in another file */ | ||
Hello Other! | ||
``` | ||
|
||
The Xtext integration supports typical Xtext and Language Server features like | ||
|
||
* Syntax Highlighting | ||
* Validation | ||
* Cross References | ||
* Tooltips | ||
* Formatter | ||
* Mark Occurrences | ||
|
||
A introductory article can be found [here](https://blogs.itemis.com/en/integrating-xtext-language-support-in-visual-studio-code) |