Skip to content

Commit

Permalink
docs: Apply editor configurations from a ConfigMap (#2841)
Browse files Browse the repository at this point in the history
* docs: Apply editor configurations from a ConfigMap

Signed-off-by: RomanNikitenko <[email protected]>

* Update modules/administration-guide/pages/editor-configurations-for-microsoft-visual-studio-code.adoc

Co-authored-by: Jana Vrbkova <[email protected]>

* Update modules/administration-guide/pages/editor-configurations-for-microsoft-visual-studio-code.adoc

Co-authored-by: Jana Vrbkova <[email protected]>

* Update modules/administration-guide/pages/editor-configurations-for-microsoft-visual-studio-code.adoc

Co-authored-by: Jana Vrbkova <[email protected]>

* Update modules/administration-guide/pages/editor-configurations-for-microsoft-visual-studio-code.adoc

Co-authored-by: Jana Vrbkova <[email protected]>

* Update formatting for ConfigMap sections

Signed-off-by: RomanNikitenko <[email protected]>

---------

Signed-off-by: RomanNikitenko <[email protected]>
Co-authored-by: Jana Vrbkova <[email protected]>
  • Loading branch information
RomanNikitenko and deerskindoll authored Dec 16, 2024
1 parent 1f8e947 commit a2fe463
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/administration-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
** xref:configuring-single-and-multiroot-workspaces.adoc[]
** xref:trusted-extensions-for-microsoft-visual-studio-code.adoc[]
** xref:default-extensions-for-microsoft-visual-studio-code.adoc[]
** xref:editor-configurations-for-microsoft-visual-studio-code.adoc[]
* xref:managing-workloads-using-the-che-server-api.adoc[]
* xref:upgrading-che.adoc[]
** xref:upgrading-the-chectl-management-tool.adoc[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Learn how to configure Visual Studio Code - Open Source ("Code - OSS").
* xref:configuring-single-and-multiroot-workspaces.adoc[]
* xref:trusted-extensions-for-microsoft-visual-studio-code.adoc[]
* xref:default-extensions-for-microsoft-visual-studio-code.adoc[]
* xref:editor-configurations-for-microsoft-visual-studio-code.adoc[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
:_content-type: PROCEDURE
:description: Applying editor configurations
:keywords: settings, extensions, configurations
:navtitle: Applying editor configurations
// :page-aliases:

[id="visual-studio-code-editor-configs"]
= Applying editor configurations

You can configure Visual Studio Code - Open Source editor by adding configurations to a ConfigMap.
These configurations are applied to any workspace you open.
Once a workspace is started, the editor checks for this ConfigMap and stores configurations to the corresponding config files.

The following sections are currently supported:

* settings.json
* extensions.json

The `settings.json` section contains various settings that allow to customize different parts of the Code - OSS editor. +
The `extensions.json` section contains recommented extensions are installed when a workspace is started.

.Procedure

* Add a new ConfigMap to the user's {orch-namespace}, define the `settings.json` and `extensions.json` sections, specify the settings you want to add, and the IDs of the extensions you want to install.
+
====
[source,yaml]
----
apiVersion: v1
kind: ConfigMap
metadata:
name: vscode-editor-configurations
data:
extensions.json: |
{
"recommendations": [
"dbaeumer.vscode-eslint",
"github.vscode-pull-request-github"
]
}
settings.json: |
{
"window.header": "A HEADER MESSAGE",
"window.commandCenter": false,
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#CCA700",
"titleBar.activeForeground": "#ffffff"
}
}
immutable: false
----
====

* Start or restart your workspace

[NOTE]
====
Make sure that the Configmap contains data in a valid JSON format.
====

.Verification
. Verify that settings defined in the ConfigMap are applied using one of the following methods:
* Use `F1 → Preferences: Open Remote Settings` to check if the defined settings are applied.
* Ensure that the settings from the ConfigMap are present in the `/checode/remote/data/Machine/settings.json` file by using the `F1 → File: Open File...` command to inspect the file's content.

. Verify that extensions defined in the ConfigMap are applied:
* Go to the `Extensions` view (`F1 → View: Show Extensions`) and check that the extensions are installed
* Ensure that the extensions from the ConfigMap are present in the `.code-workspace` file by using the `F1 → File: Open File...` command. By default, the workspace file is placed at `/projects/.code-workspace`.


0 comments on commit a2fe463

Please sign in to comment.