Skip to content

Latest commit

 

History

History
32 lines (18 loc) · 1.16 KB

README.md

File metadata and controls

32 lines (18 loc) · 1.16 KB

Running an Xtext-generated language server in Emacs

This repository contains sample code showing how to run a language server generated by Xtext from within Emacs via emacs-lsp.

The “entities” language used for this example is described in the book Implementing Domain-Specific Languages with Xtext and Xtend - Second Edition by Lorenzo Bettini.

The Language Server

Build the language server with the following command:

cd xtext-lsp-server ; ./gradlew assemble

The Tree-Sitter Grammar

Build the tree-sitter grammar with the following command:

cd tree-sitter-entities ; npm install

Emacs

  1. Load emacs/entities-mode.el into Emacs

  2. Check the path in entities-ls-jar; adapt if necessary

  3. Open sample.entities in Emacs

  4. Start the language server with M-x eglot (or M-x lsp if you use lsp-mode)

  5. Position the cursor on Hello25; check that cross-highlighting and M-. (aka M-x xref-find-definitions) work