|
| 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