-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documantation how to add support for a new language
Signed-off-by: Valeriy Svydenko <[email protected]>
- Loading branch information
Showing
1 changed file
with
21 additions
and
16 deletions.
There are no files selected for viewing
37 changes: 21 additions & 16 deletions
37
src/main/pages/che-7/contributor-guide/proc_adding-support-for-a-new-language.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.] |