Skip to content

Commit a2fe463

Browse files
docs: Apply editor configurations from a ConfigMap (#2841)
* 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]>
1 parent 1f8e947 commit a2fe463

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

modules/administration-guide/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
** xref:configuring-single-and-multiroot-workspaces.adoc[]
110110
** xref:trusted-extensions-for-microsoft-visual-studio-code.adoc[]
111111
** xref:default-extensions-for-microsoft-visual-studio-code.adoc[]
112+
** xref:editor-configurations-for-microsoft-visual-studio-code.adoc[]
112113
* xref:managing-workloads-using-the-che-server-api.adoc[]
113114
* xref:upgrading-che.adoc[]
114115
** xref:upgrading-the-chectl-management-tool.adoc[]

modules/administration-guide/pages/configuring-visual-studio-code.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ Learn how to configure Visual Studio Code - Open Source ("Code - OSS").
1212
* xref:configuring-single-and-multiroot-workspaces.adoc[]
1313
* xref:trusted-extensions-for-microsoft-visual-studio-code.adoc[]
1414
* xref:default-extensions-for-microsoft-visual-studio-code.adoc[]
15+
* xref:editor-configurations-for-microsoft-visual-studio-code.adoc[]
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
:_content-type: PROCEDURE
2+
:description: Applying editor configurations
3+
:keywords: settings, extensions, configurations
4+
:navtitle: Applying editor configurations
5+
// :page-aliases:
6+
7+
[id="visual-studio-code-editor-configs"]
8+
= Applying editor configurations
9+
10+
You can configure Visual Studio Code - Open Source editor by adding configurations to a ConfigMap.
11+
These configurations are applied to any workspace you open.
12+
Once a workspace is started, the editor checks for this ConfigMap and stores configurations to the corresponding config files.
13+
14+
The following sections are currently supported:
15+
16+
* settings.json
17+
* extensions.json
18+
19+
The `settings.json` section contains various settings that allow to customize different parts of the Code - OSS editor. +
20+
The `extensions.json` section contains recommented extensions are installed when a workspace is started.
21+
22+
.Procedure
23+
24+
* 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.
25+
+
26+
====
27+
[source,yaml]
28+
----
29+
apiVersion: v1
30+
kind: ConfigMap
31+
metadata:
32+
name: vscode-editor-configurations
33+
data:
34+
extensions.json: |
35+
{
36+
"recommendations": [
37+
"dbaeumer.vscode-eslint",
38+
"github.vscode-pull-request-github"
39+
]
40+
}
41+
settings.json: |
42+
{
43+
"window.header": "A HEADER MESSAGE",
44+
"window.commandCenter": false,
45+
"workbench.colorCustomizations": {
46+
"titleBar.activeBackground": "#CCA700",
47+
"titleBar.activeForeground": "#ffffff"
48+
}
49+
}
50+
immutable: false
51+
----
52+
====
53+
54+
* Start or restart your workspace
55+
56+
[NOTE]
57+
====
58+
Make sure that the Configmap contains data in a valid JSON format.
59+
====
60+
61+
.Verification
62+
. Verify that settings defined in the ConfigMap are applied using one of the following methods:
63+
* Use `F1 → Preferences: Open Remote Settings` to check if the defined settings are applied.
64+
* 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.
65+
66+
. Verify that extensions defined in the ConfigMap are applied:
67+
* Go to the `Extensions` view (`F1 → View: Show Extensions`) and check that the extensions are installed
68+
* 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`.
69+
70+

0 commit comments

Comments
 (0)