Skip to content

Sample code showing how to run a language server generated by Xtext from Emacs via emacs-lsp

Notifications You must be signed in to change notification settings

rudi/xtext-emacs-lsp-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Sample code showing how to run a language server generated by Xtext from Emacs via emacs-lsp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published