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 VS Code extension API. Note that it is also possible to directly connect a Che-Theia plug-in or a VS Code extension to the plug-in API.
-
Install the latest Che-Theia plug-in Yeoman generator. Follow the documentation about how to develop Che-Theia plug-in with Yeoman.
-
Generate a sample by running the
yo @theia/plugincommand. 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.jsfile. This file will be downloaded during the build process of the plug-in. If the name ofsrc/download-xml-ls.jschanged, replace it in thepackage.jsonfile in thescriptsblock. -
Replace the configuration of the language in the
src/language-configuration.jsonfile. This file contains configuration options for the current language. If the name ofsrc/language-configuration.jsonchanged, replace it in thepackage.jsonfile in thecontributionblock. -
Replace the configuration of the language in the
src/xml.tmLanguage.jsonfile. This file describes syntax highlighting. If the name ofsrc/xml.tmLanguage.jsonchanged, replace it in thepackage.jsonfile in thecontribution.grammarsblock. -
Replace the information about the provided language in the
src/plug-in_name.tsfile. 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
yarnin the root of the project.