Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Xtext VS Code exampleNew to Visual Studio Code? Get it now.

Xtext VS Code example

itemis AG

|
1,558 installs
| (3) | Free
A simple DSL example for VS Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Xtext VS Code example

This is a simple example showing the Xtext integration for VS Code based on the 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
  • Goto Definition / Find References
  • Hover
  • Formatting
  • Mark Occurrences
  • Open Symbol

A introductory article can be found here

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2022 Microsoft