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.

Prerequisites
Procedure
  1. 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.

  2. 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 of src/download-xml-ls.js changed, replace it in the package.json file in the scripts block.

  3. 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 of src/language-configuration.json changed, replace it in the package.json file in the contribution block.

  4. Replace the configuration of the language in the src/xml.tmLanguage.json file. This file describes syntax highlighting. If the name of src/xml.tmLanguage.json changed, replace it in the package.json file in the contribution.grammars block.

  5. 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.

  6. Build the plug-in by running yarn in the root of the project.

Tags: