Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jana Vrbkova <jvrbkova@redhat.com>
  • Loading branch information
vitaliy-guliy and deerskindoll authored Nov 19, 2024
1 parent 723ef3e commit 020c358
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
// :page-aliases:

[id="visual-studio-code-default-extensions"]
= Configure default extensions
= Configuring default extensions

Default extensions are a pre-installed set of extensions, specified by putting the extension binary `.vsix` file path to the __DEFAULT_EXTENSIONS__ environment variable.

After startup, the editor checks for this environment variable, and if it is specified, takes the path to the extensions and installs it in the background without disturbing the user.

Default extensions described in this documentation are useful for installing .vsix extensions by default from the editor level.
Configuring default extensions is useful for installing .vsix extensions from the editor level.

[NOTE]
====
You can specify several extensions separated by semicolon.
If you want to specify multiple extensions, separate them by semicolon.
[source,yaml]
----
DEFAULT_EXTENSIONS='/projects/extension-1.vsix;/projects/extension-2.vsix'
----
====

Read on to learn how to define the DEFAULT_EXTENSIONS environment variable with multiple examples of adding `.vsix` files to your workspace.
Read on to learn how to define the DEFAULT_EXTENSIONS environment variable, including multiple examples of adding `.vsix` files to your workspace.

There are three different ways to embed default `.vsix` extensions into your workspace:

Expand Down Expand Up @@ -61,9 +61,9 @@ You can use cURL or GNU Wget to download extensions to your workspace.
For that you need to:

--
** specify a devfile command to download one or several extensions to your workpace
** add a *postStart* event to run the command on workspace startup
** define the __DEFAULT_EXTENSIONS__ environment variable in the Devfile
* specify a devfile command to download extensions to your workpace
* add a `postStart` event to run the command on workspace startup
* define the __DEFAULT_EXTENSIONS__ environment variable in the devfile
--

.Procedure
Expand Down Expand Up @@ -101,7 +101,7 @@ events:
+
[WARNING]
====
In some cases *curl* may download a *gzip* compressed file. This may make it impossible to install the extension.
In some cases curl may download a `.gzip` compressed file. This might make installing the extension impossible.
To fix that try to save the file as a *.vsix.gz* file and then decompress it with *gunzip*. This will replace the *.vsix.gz* file with an unpacked *.vsix* file.
[source,yaml]
Expand All @@ -113,14 +113,14 @@ gunzip /tmp/extension.vsix.gz

.Including the extensions `.vsix` binaries in the `che-code` image.

With default extensions bundled in the editor image along with the __DEFAULT_EXTENSIONS__ environment variable defined in a ConfigMap, you can apply the default extensions without changing the devfile.
With default extensions bundled in the editor image, and the __DEFAULT_EXTENSIONS__ environment variable defined in the ConfigMap, you can apply the default extensions without changing the devfile.

Following steps will help you to add the extensions you need to the editor image.
Following the steps below to add the extensions you need to the editor image.

.Procedure
* Create a directory and place one or several *.vsix* extensions in this directory.
* Create a directory and place your selected `.vsix` extensions in this directory.

* Create a Dockerfile with following content.
* Create a Dockerfile with the following content:
+
====
[source,]
Expand All @@ -138,7 +138,7 @@ RUN echo "cp -r /default-extensions /checode/" >> /entrypoint-init-container.sh
----
====

* Build the image and then push it to a registry.
* Build the image and then push it to a registry:
+
====
[,console]
Expand All @@ -148,7 +148,7 @@ $ docker push yourname/che-code:next
----
====

* Add the new ConfigMap in the user's {orch-namespace}, define the __DEFAULT_EXTENSIONS__ environment variable and specify the absolute paths to the extensions. This ConfigMap sets the environment variable to all workspaces in the user's {orch-namespace}.
* Add the new ConfigMap to the user's {orch-namespace}, define the __DEFAULT_EXTENSIONS__ environment variable, and specify the absolute paths to the extensions. This ConfigMap sets the environment variable to all workspaces in the user's {orch-namespace}.
+
====
[source,yaml]
Expand All @@ -167,7 +167,7 @@ data:
----
====

* Create a workspace using *yourname/che-code:next* image.
* Create a workspace using `yourname/che-code:next` image.
First, open the dashboard and navigate to the *Create Workspace* tab on the left side.
+
--
Expand Down

0 comments on commit 020c358

Please sign in to comment.