Adding tools to Che after creating a workspace
When installed in a workspace, Che plug-ins bring new capabilities to Che. Plug-ins consist of a Che-Theia plug-in, metadata, and a hosting container. These plug-ins may provide the following capabilities:
-
Integrating with other systems, including Kubernetes or OpenShift.
-
Automating some developer tasks, such as formatting, refactoring, and running automated tests.
-
Communicating with multiple databases directly from the IDE.
-
Enhanced code navigation, auto-completion and error highlighting.
This chapter provides basic information about installing, enabling, and using Che plug-ins in workspaces.
Additional tools in the Che workspace
Che plug-ins are extensions to the Che-Theia IDE that come bundled with container images. These images contain the native prerequisites of their respective extensions. For example, the oc command-line tool is bundled with a command to install it, which ensures the proper functionality of the OpenShift Connector plug-in, all available in the dedicated image.
Plug-ins can also include metadata to define a description, categorization tags, and an icon. Che provides a registry of plug-ins available for installation into the user’s workspace.
The Che-Theia IDE is generally compatible with the VS Code extensions API and VS Code extensions are automatically compatible with Che-Theia. These extensions are possible to package as Che plug-ins by combining them with their dependencies. By default, Che includes a plug-in registry containing common plug-ins.
-
Using the Dashboard:
-
Add a plug-in from the plug-in registry using the Plugins tab in the Workspace details page.
-
Add a plug-in directly into a devfile using the Devfile tab.
The devfile can also further the plug-in configuration, such as defining memory or CPU usage.
-
-
Using the Che-Theia IDE:
-
By pressing Ctrl+Shift+J or by navigating to View → Plugins.
-
Adding a language support plug-in to a Che workspace
This procedure describes adding a tool to an existing workspace by enabling a dedicated plug-in from the Dashboard.
To add tools that are available as plug-ins into a Che workspace, use one of the following methods:
This procedure uses the Language Support for Java plug-in as an example.
-
A running instance of Eclipse Che. To install an instance of Eclipse Che, see Installing Che.
-
An existing workspace defined in this instance of Eclipse Che; see:
-
The workspace must be in a stopped state. To stop a workspace,
-
Navigate to the Che Dashboard. See Navigating Che using the Dashboard.
-
In the Dashboard, click the Workspaces menu to open the workspaces list and locate the workspace.
-
On the same row with the displayed workspace, on the right side of the screen, click the square Stop button to stop the workspace.
-
Wait a few seconds for the workspace to stop (the workspace’s icon on the list will turn grey), then configure the workspace by clicking on it.
-
To add the plug-in from the Plug-in registry to an existing Che workspace, use one of the following methods:
-
Installing the plug-in from the Plugins tab.
-
Navigate to the Plugins tab. The list of available plug-ins is displayed.
-
Enable the desired plug-in, for example, the Language Support for Java 11, by using the Enable slide-toggle. This will add the plug-in’s ID to the workspace’s devfile, enabling the plug-in.
-
On the bottom right side of the screen, save the changes by clicking the Save button. After changes are saved, the workspace can be restarted and will include the new plug-in.
-
-
Installing the plug-in by adding content to the devfile.
-
Navigate to the Devfile tab. The devfile YAML is displayed.
-
Locate the
components
section of the devfile and add the following lines to add the Java language plugin with Java 8 to the workspace:- id: redhat/java8/latest type: chePlugin
An example of the final result:
components: - id: redhat/php/latest memoryLimit: 1Gi type: chePlugin - id: redhat/php-debugger/latest memoryLimit: 256Mi type: chePlugin - mountSources: true endpoints: - name: 8080/tcp port: 8080 memoryLimit: 512Mi type: dockerimage volumes: - name: composer containerPath: /home/user/.composer - name: symfony containerPath: /home/user/.symfony alias: php image: 'quay.io/eclipse/che-php-7:nightly' - id: redhat/java8/latest type: chePlugin
-
On the bottom right side of the screen, save the changes by clicking the Save button. After changes are saved, the workspace can be restarted and will include the new plug-in.
-