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.

Adding a plug-in
  • 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.

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

    1. Navigate to the Plugins 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