Skip to content
XML Language Server
Java JavaScript Other
Branch: master
Clone or download
NikolasKomonen and angelozerr CodeAction for missing end tag
Creates a code action for both MarkupEntityMismatch and ETagRequired errors

Fixes #588

Signed-off-by: Nikolas Komonen <>
Latest commit 5606fa7 Nov 15, 2019

XML Language Server (lsp4xml)

Build Status

The lsp4xml is a XML language specific implementation of the Language Server Protocol and can be used with any editor that supports the protocol, to offer good support for the XML Language. The server is based on:

  • Eclipse LSP4J, the Java binding for the Language Server Protocol.
  • Xerces to manage XML Schema validation, completion and hover


See screenshots in the wiki.

See the changelog for the latest release.


The XML Language Server is extensible with plugin kind (with SPI). Here existings extensions:

  • content model to provide completion, validation, hover based on XML Schema.
  • emmet to provide completion based on Emmet.


XML Language Server Demo

Get started

  • Clone this repository
  • Open the folder in your terminal / command line
  • Run ./mvnw clean verify (OSX, Linux) or mvnw.cmd clean verify (Windows)
  • After successful compilation you can find the resulting org.eclipse.lsp4xml-uber.jar in the folder org.eclipse.lsp4xml/target


To debug the XML LS you can use XMLServerSocketLauncher:

  1. Run the XMLServerSocketLauncher in debug mode (e.g. in eclipse)
  2. Connect your client via socket port. Default port is 5008, but you can change it with start argument --port in step 1

Client connection example using Theia and TypeScript:

let socketPort = '5008'
console.log(`Connecting via port ${socketPort}`)
const socket = new net.Socket()
const serverConnection = createSocketConnection(socket,
    socket, () => {
this.forward(clientConnection, serverConnection)

Maven coordinates:

Here are the Maven coordinates for lsp4xml (replace the X.Y.Z version with the latest release):

    <!-- classifier:uber includes all dependencies -->

for Gradle:

compile(group: 'org.lsp4xml', name: 'org.eclipse.lsp4xml', version: 'X.Y.Z', classifier: 'uber')

You will have to reference the Maven repository hosting the dependency you need. E.g. for Maven, add this repository to your pom.xml or settings.xml :


or P2 repository:<VERSION>

And if you want to consume the SNAPSHOT builds instead:


or P2 repository:<VERSION>


Here are some clients consuming this XML Language Server:

Gracefully powered by Artifactory

You can’t perform that action at this time.