Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documantation how to add support for a new language #746

Merged
merged 2 commits into from
Aug 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

tsmaeder marked this conversation as resolved.
Show resolved Hide resolved
[discrete]
== Prerequisites
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.

* 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.]