Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 5. Managing IDE extensions
IDEs use extensions or plugins to extend their functionality, and the mechanism for managing extensions differs between IDEs.
5.1. Extensions for Microsoft Visual Studio Code - Open Source Link kopierenLink in die Zwischenablage kopiert!
To manage extensions, this IDE uses one of these Open VSX registry instances:
-
The embedded instance of the Open VSX registry that runs in the
plugin-registrypod of OpenShift Dev Spaces to support air-gapped, offline, and proxy-restricted environments. The embedded Open VSX registry contains only a subset of the extensions published on open-vsx.org. This subset is customizable. - The public open-vsx.org registry that is accessed over the internet.
- A standalone Open VSX registry instance that is deployed on a network accessible from OpenShift Dev Spaces workspace pods.
The default is the embedded instance of the Open VSX registry.
5.1.1. Selecting an Open VSX registry instance Link kopierenLink in die Zwischenablage kopiert!
The default is the embedded instance of the Open VSX registry.
If the default Open VSX registry instance is not what you need, you can select one of the following instances:
-
The Open VSX registry instance at
https://open-vsx.orgthat requires access to the internet. - A standalone Open VSX registry instance that is deployed on a network accessible from OpenShift Dev Spaces workspace pods.
Procedure
Edit the
openVSXURLvalue in theCheClustercustom resource:spec: components: pluginRegistry: openVSXURL: "<url_of_an_open_vsx_registry_instance>"spec: components: pluginRegistry: openVSXURL: "<url_of_an_open_vsx_registry_instance>"1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- For example:
openVSXURL: "https://open-vsx.org".
Important- Using https://open-vsx.org is not recommended in an air-gapped environment, isolated from the internet. In order to reduce the risk of malware infections and unauthorized access to your code use the embedded or self-hosted Open VSX registry with a curated set of extensions.
-
To select the embedded Open VSX registry instance in the
plugin-registrypod, useopenVSXURL: ''. You can customize the list of included extensions. -
You can also point
openVSXURLat the URL of a standalone Open VSX registry instance if its URL is accessible from within your organization’s cluster and not blocked by a proxy.
5.1.2. Adding or removing extensions in the embedded Open VSX registry instance Link kopierenLink in die Zwischenablage kopiert!
You can add or remove extensions in the embedded Open VSX registry instance. This results in a custom build of the Open VSX registry that can be used in your organization’s workspaces.
To get the latest security fixes after a OpenShift Dev Spaces update, rebuild your container based on the latest tag or SHA.
Procedure
Get the publisher and extension name of each chosen extension:
- Find the extension on the Open VSX registry website and copy the URL of the extension’s listing page and extension’s version.
Extract the <publisher> and <extension> name from the copied URL:
https://open-vsx.org/extension/<publisher>/<name>
https://open-vsx.org/extension/<publisher>/<name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow TipIf the extension is only available from Microsoft Visual Studio Marketplace, but not Open VSX, you can ask the extension publisher to also publish it on open-vsx.org according to these instructions, potentially using this GitHub action.
If the extension publisher is unavailable or unwilling to publish the extension to open-vsx.org, and if there is no Open VSX equivalent of the extension, consider reporting an issue to the Open VSX team.
Build the custom plugin registry image and update CheCluster custom resource:
Tip- During the build process, each extension will be verified for compatibility with the version of Visual Studio Code used in OpenShift Dev Spaces.
Using OpenShift Dev Spaces instance:
ImportantFor IBM Power (
ppc64le) and IBM Z (s390x), the custom plugin registry is expected to be built locally on the corresponding architecture.- Login to your OpenShift Dev Spaces instance as an administrator.
Create a new Red Hat Registry Service Account and copy username and token.
- Start a workspace using the plugin registry repository.
Open a terminal and check out the Git tag that corresponds to your OpenShift Dev Spaces version (e.g.,
devspaces-3.15-rhel-8):git checkout devspaces-$PRODUCT_VERSION-rhel-8
git checkout devspaces-$PRODUCT_VERSION-rhel-8Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Open the
openvsx-sync.jsonfile and add or remove extensions. -
Run
1. Login to registry.redhat.iotask in the workspace (TerminalRun Task… devfile 1. Login to registry.redhat.io) and login to registry.redhat.io. -
Run
2. Build and Publish a Custom Plugin Registrytask in the workspace (TerminalRun Task… devfile 2. Build and Publish a Custom Plugin Registry). Run
3. Configure Che to use the Custom Plugin Registrytask in the workspace (TerminalRun Task… devfile 3. Configure Che to use the Custom Plugin Registry). Using Linux operating system:
Tip- Podman and NodeJS version 18.20.3 or higher should be installed in the system.
Download or fork and clone the Dev Spaces repository.
git clone https://github.com/redhat-developer/devspaces.git
git clone https://github.com/redhat-developer/devspaces.gitCopy to Clipboard Copied! Toggle word wrap Toggle overflow Go to the plugin registry submodule:
cd devspaces/dependencies/che-plugin-registry/
cd devspaces/dependencies/che-plugin-registry/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Checkout the tag that corresponds to your OpenShift Dev Spaces version (e.g.,
devspaces-3.15-rhel-8):git checkout devspaces-$PRODUCT_VERSION-rhel-8
git checkout devspaces-$PRODUCT_VERSION-rhel-8Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a new Red Hat Registry Service Account and copy username and token.
Login to registry.redhat.io:
podman login registry.redhat.io
podman login registry.redhat.ioCopy to Clipboard Copied! Toggle word wrap Toggle overflow For each extension that you need to add or remove, edit the
openvsx-sync.jsonfile:-
To add extensions, add the publisher, name and extension version to the
openvsx-sync.jsonfile. -
To remove extensions, remove the publisher, name and extension version from the
openvsx-sync.jsonfile. Use the following JSON syntax:
{ "id": "<publisher>.<name>", "version": "<extension_version>" }{ "id": "<publisher>.<name>", "version": "<extension_version>" }Copy to Clipboard Copied! Toggle word wrap Toggle overflow TipIf you have a closed-source extension or an extension developed only for internal use in your organization, you can add the extension directly from a
.vsixfile by using a URL accessible to your custom plugin registry container:{ "id": "<publisher>.<name>", "download": "<url_to_download_vsix_file>", "version": "<extension_version>" }{ "id": "<publisher>.<name>", "download": "<url_to_download_vsix_file>", "version": "<extension_version>" }Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Read the Terms of Use for the Microsoft Visual Studio Marketplace before using its resources.
-
To add extensions, add the publisher, name and extension version to the
Build the plugin registry container image and publish it to a container registry such as quay.io:
./build.sh -o <username> -r quay.io -t custom
$ ./build.sh -o <username> -r quay.io -t customCopy to Clipboard Copied! Toggle word wrap Toggle overflow podman push quay.io/<username/plugin_registry:custom>
$ podman push quay.io/<username/plugin_registry:custom>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Edit the
CheClustercustom resource in your organization’s cluster to point to the image (for example, on quay.io) and save the changes:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
-
Check that the
plugin-registrypod has restarted and is running. - Restart the workspace and check the available extensions in the Extensions view of the workspace IDE.
5.2. Open VSX registry URL Link kopierenLink in die Zwischenablage kopiert!
To search and install extensions, the Microsoft Visual Studio Code - Open Source editor uses an embedded Open VSX registry instance. You can also configure OpenShift Dev Spaces to use another Open VSX registry instance rather than the embedded one.
Procedure
Set the URL of your Open VSX registry instance in the CheCluster Custom Resource
spec.components.pluginRegistry.openVSXURLfield.Copy to Clipboard Copied! Toggle word wrap Toggle overflow WarningDue to the dedicated Microsoft Terms of Use, Visual Studio Code Marketplace is not supported by Red Hat OpenShift Dev Spaces.