Adding support for a new language
This section describes how to add support for a new language into Eclipse Che.
The described method is to write a Che-Theia plug-in that uses the languageserver-node library to connect a language server to the Visual Studio Code extension API. Note that it is also possible to directly connect a Che-Theia plug-in or a Visual Studio Code extension to the plug-in API.
-
Install the latest Che-Theia plug-in Yeoman generator. Follow the documentation about Developing Che-Theia plug-ins.
-
Generate a sample by running the
yo @theia/plugin
command. When prompted, confirm the choices for Backend plug-in, Samples, and then Language sample. This creates a project and a ready-to-use plug-in, which provides support for XML Language Server and can be deployed. -
Replace the download URL of the implementation of the language server protocol in the
src/download-xml-ls.js
file. This file will be downloaded during the build process of the plug-in. If the name ofsrc/download-xml-ls.js
changed, replace it in thepackage.json
file in thescripts
block. -
Replace the configuration of the language in the
src/language-configuration.json
file. This file contains configuration options for the current language. If the name ofsrc/language-configuration.json
changed, replace it in thepackage.json
file in thecontribution
block. -
Replace the configuration of the language in the
src/xml.tmLanguage.json
file. This file describes syntax highlighting. If the name ofsrc/xml.tmLanguage.json
changed, replace it in thepackage.json
file in thecontribution.grammars
block. -
Replace the information about the provided language in the
src/plug-in_name.ts
file. This file contains information about the location of the Language Server Protocol (LSP) implementation and the command with arguments to run it. -
Build the plug-in by running
yarn
in the root of the project.