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.
Build the language server with the following command:
cd xtext-lsp-server ; ./gradlew assemble
Build the tree-sitter grammar with the following command:
cd tree-sitter-entities ; npm install
-
Load
emacs/entities-mode.el
into Emacs -
Check the path in
entities-ls-jar
; adapt if necessary -
Open
sample.entities
in Emacs -
Start the language server with
M-x eglot
(orM-x lsp
if you use lsp-mode) -
Position the cursor on
Hello25
; check that cross-highlighting andM-.
(akaM-x xref-find-definitions
) work