From 2c9b9137b4863fde64321b11e66fd5f84215101a Mon Sep 17 00:00:00 2001 From: Valeriy Svydenko Date: Wed, 7 Aug 2019 09:19:00 +0300 Subject: [PATCH 1/2] Add documantation how to add support for a new language Signed-off-by: Valeriy Svydenko --- ...roc_adding-support-for-a-new-language.adoc | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/main/pages/che-7/contributor-guide/proc_adding-support-for-a-new-language.adoc b/src/main/pages/che-7/contributor-guide/proc_adding-support-for-a-new-language.adoc index 0d448d0b06..a3872c265f 100644 --- a/src/main/pages/che-7/contributor-guide/proc_adding-support-for-a-new-language.adoc +++ b/src/main/pages/che-7/contributor-guide/proc_adding-support-for-a-new-language.adoc @@ -1,27 +1,32 @@ [id="adding-support-for-a-new-language_{context}"] = Adding support for a new language -This paragraph is the procedure module introduction: a short description of the procedure. +This section describes how to add support for a new language into Eclipse Che. -[discrete] -== Prerequisites +The described method is to writer 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. -* A bulleted list of conditions that must be satisfied before the user starts following this assembly. -* You can also link to other modules or assemblies the user must follow before starting this assembly. -* Delete the section title and bullets if the assembly has no prerequisites. +.Prerequisites +* Install the latest Che-Theia plug-in Yeoman generator. Follow the documentation about link:developing-che-theia-plug-ins.html#bootstrapping-che-theia-plug-in-development-with-yeoman_developing-che-theia-plug-ins[how to develop Che-Theia plug-in with Yeoman.] + +.Procedure -[discrete] -== Procedure +. 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. -. Start each step with an active verb. +. 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. -. Include one command or action per step. +. 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. -. Use an unnumbered bullet (*) if the procedure includes only one step. +. 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. -[discrete] -== Additional resources +. 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. -* A bulleted list of links to other material closely related to the contents of the procedure module. -* For more details on writing procedure modules, see the link:https://github.com/redhat-documentation/modular-docs#modular-documentation-reference-guide[Modular Documentation Reference Guide]. -* Use a consistent system for file names, IDs, and titles. For tips, see _Anchor Names and File Names_ in link:https://github.com/redhat-documentation/modular-docs#modular-documentation-reference-guide[Modular Documentation Reference Guide]. +. Build the plug-in by running `yarn` in the root of the project. + + +.Additional resources + +* link:https://github.com/eclipse/che-theia-samples/tree/master/samples/xml-language-server-plugin[Theia plug-in with XML Language Server] +* link:https://microsoft.github.io/language-server-protocol/[Language Server Protocol] +* link:https://code.visualstudio.com/api/language-extensions/overview[VS Code Language Extensions Documentation] +* link:https://code.visualstudio.com/api/language-extensions/language-server-extension-guide[A simple Language Server for plain text files] +* link:publishing-che-theia-plug-ins.html#adding-a-che-theia-plug-in-to-the-che-plug-in-registry_publishing-che-theia-plug-ins[Add the plug-in to the Che plug-in registry.] From 0c8ea7418bd4500475695737cc453ba16b44267e Mon Sep 17 00:00:00 2001 From: Valeriy Svydenko Date: Wed, 7 Aug 2019 12:58:26 +0300 Subject: [PATCH 2/2] Fix remarks Signed-off-by: Valeriy Svydenko --- .../proc_adding-support-for-a-new-language.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/pages/che-7/contributor-guide/proc_adding-support-for-a-new-language.adoc b/src/main/pages/che-7/contributor-guide/proc_adding-support-for-a-new-language.adoc index a3872c265f..a209b4407a 100644 --- a/src/main/pages/che-7/contributor-guide/proc_adding-support-for-a-new-language.adoc +++ b/src/main/pages/che-7/contributor-guide/proc_adding-support-for-a-new-language.adoc @@ -3,7 +3,7 @@ This section describes how to add support for a new language into Eclipse Che. -The described method is to writer 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. +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 * Install the latest Che-Theia plug-in Yeoman generator. Follow the documentation about link:developing-che-theia-plug-ins.html#bootstrapping-che-theia-plug-in-development-with-yeoman_developing-che-theia-plug-ins[how to develop Che-Theia plug-in with Yeoman.]