Publishing metadata for a Visual Studio Code extension

To use a Visual Studio Code extension in a Che workspace, Che needs to consume metadata describing the extension. The Che plug-ins registry is a static website publishing metadata for common Visual Studio Code extensions.

This article describes how to publish metadata for an additional extension, not available in the Che plug-ins registry, by using the extension configuration meta.yaml file.

For details on adding a plug-in to an existing plug-in registry, see Adding a Visual Studio Code extension to the Che plug-ins registry

Prerequisite
  • If the Visual Studio Code extension requires it, the required associated container image is available.

Procedure
  1. Create a meta.yaml file.

  2. Edit the meta.yaml file and provide the necessary information. The file must have the following structure:

    apiVersion: v2                                                   (1)
    publisher: myorg                                                 (2)
    name: my-vscode-ext                                              (3)
    version: 1.7.2                                                   (4)
    type: value                                                      (5)
    displayName:                                                     (6)
    title:                                                           (7)
    description:                                                     (8)
    icon: https://www.eclipse.org/che/images/logo-eclipseche.svg     (9)
    repository:                                                     (10)
    category:                                                       (11)
    spec:
      containers:                                                   (12)
        - image:                                                    (13)
          memoryLimit:                                              (14)
          memoryRequest:                                            (15)
          cpuLimit:                                                 (16)
          cpuRequest:                                               (17)
      extensions:                                                   (18)
              - https://github.com/redhat-developer/vscode-yaml/releases/download/0.4.0/redhat.vscode-yaml-0.4.0.vsix
              - https://github.com/SonarSource/sonarlint-vscode/releases/download/1.16.0/sonarlint-vscode-1.16.0.vsix
    1 Version of the file structure.
    2 Name of the plug-in publisher. Must be the same as the publisher in the path.
    3 Name of the plug-in. Must be the same as in path.
    4 Version of the plug-in. Must be the same as in path.
    5 Type of the plug-in. Possible values: Che Plugin, Che Editor, Theia plugin, Visual Studio Code extension.
    6 A short name of the plug-in.
    7 Title of the plug-in.
    8 A brief explanation of the plug-in and what it does.
    9 The link to the plug-in logo.
    10 Optional. The link to the source-code repository of the plug-in.
    11 Defines the category that this plug-in belongs to. Should be one of the following: Editor, Debugger, Formatter, Language, Linter, Snippet, Theme, or Other.
    12 If this section is omitted, the Visual Studio Code extension is added into the Che-Theia IDE container.
    13 The Docker image from which the sidecar container will be started. Example: eclipse/che-theia-endpoint-runtime:next.
    14 The maximum RAM which is available for the sidecar container. Example: "512Mi". This value might be overridden by the user in the component configuration.
    15 The RAM which is given for the sidecar container by default. Example: "256Mi". This value might be overridden by the user in the component configuration.
    16 The maximum CPU amount in cores or millicores (suffixed with "m") which is available for the sidecar container. Examples: "500m", "2". This value might be overridden by the user in the component configuration.
    17 The CPU amount in cores or millicores (suffixed with "m") which is given for the sidecar container by default. Example: "125m". This value might be overridden by the user in the component configuration.
    18 A list of Visual Studio Code extensions run in this sidecar container.
  3. Publish the meta.yaml file as an HTTP resource by creating a gist on GitHub or GitLab with a file content published there.