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 OpenShift and Kubernetes.

  • 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 a container image that contains their native prerequisites (for example, the OpenShift Connector plug-in needs the oc command installed). 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. This means that many VS Code extensions are automatically compatible with Che-Theia, and can be packaged as Che plug-ins by combining them container that contains their dependencies. By default, Che includes a plug-in registry containing common plug-ins.

From the Dashboard, plug-ins in the registry can be added from the Plugin tab in the Workspace details page, or by adding them directly into a devfile. The devfile can also be used for further configuration of the plug-in, such defining memory or CPU usage. Alternatively, plug-ins can also be installed from within 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 Java language support plug-in as an example.

Prerequisites
Procedure

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 Plugin tab.

    1. Navigate to the Plugin tab. The list of available plug-ins is displayed.

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

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

    1. Navigate to the Devfile tab. The devfile YAML is displayed.

    2. 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
    3. 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.

Additional resources