diff --git a/.vscode/settings.json b/.vscode/settings.json index 33c6c6d..1945abf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,6 @@ { + "editor.formatOnPaste": true, + "cSpell.words": [ "adduser", "airgap", @@ -129,6 +131,7 @@ "xattr", "zstd" ], + "markdown.extension.toc.levels": "2..6", "markdown.extension.toc.orderedList": true } diff --git a/knowledge base/visual studio code.md b/knowledge base/visual studio code.md index 051666e..006c771 100644 --- a/knowledge base/visual studio code.md +++ b/knowledge base/visual studio code.md @@ -6,10 +6,12 @@ 1. [Handy settings](#handy-settings) 1. [Built-in](#built-in) 1. [Extensions](#extensions) - 1. [Example](#example) + 1. [Recommend extensions](#recommend-extensions) 1. [Use JSON schemas](#use-json-schemas) + 1. [Configuration example](#configuration-example) 1. [Network connections](#network-connections) 1. [Troubleshooting](#troubleshooting) + 1. [Blank window upon launch](#blank-window-upon-launch) 1. [_No extensions found_ when running from source](#no-extensions-found-when-running-from-source) 1. [Further readings](#further-readings) 1. [Sources](#sources) @@ -51,7 +53,52 @@ | yzhang.markdown-all-in-one | `markdown.extension.toc.orderedList` | `false` | User, Workspace | Extensions > Markdown All In One | Use an ordered list in the ToC. | | redhat.ansible | `redhat.telemetry.enabled` | `true` | User, Workspace | Extensions > Ansible | Send telemetry to Red Hat servers. | -### Example +### Recommend extensions + +Add the `extensions.json` file to the workspace's `.vscode` folder with the following structure: + +```json +{ + "recommendations": [ + "casualjim.gotemplate", + "golang.go", + "ms-python.python", + "nhoizey.gremlins", + "oderwat.indent-rainbow", + "redhat.ansible", + "redhat.vscode-yaml", + "streetsidesoftware.code-spell-checker", + "yzhang.markdown-all-in-one", + ] +} +``` + +The `recommendations[]` key shall contain the recommended extensions' identifiers from the Visual Studio Marketplace. + +### Use JSON schemas + +```json +"json.schemas": [ + { + "fileMatch": ["/.commitlintrc"], + "url": "https://json.schemastore.org/commitlintrc.json" + }, + { + "fileMatch": ["/.hadolint.yaml"], + "url": "https://raw.githubusercontent.com/hadolint/hadolint/master/contrib/hadolint.json" + }, + { + "fileMatch": ["/.pre-commit-config.yaml"], + "url": "https://json.schemastore.org/pre-commit-config.json" + }, + { + "fileMatch": ["/.yamllint.yaml"], + "url": "https://json.schemastore.org/yamllint.json" + } +], +``` + +### Configuration example ```json { @@ -77,38 +124,32 @@ "files.insertFinalNewline": true, "markdown.extension.orderedList.marker": "one", "markdown.extension.toc.orderedList": true, + "json.schemas": [ + { + "fileMatch": ["/.pre-commit-config.yaml"], + "url": "https://json.schemastore.org/pre-commit-config.json" + }, } ``` -### Use JSON schemas - -```json -"json.schemas": [ - { - "fileMatch": ["/.commitlintrc"], - "url": "https://json.schemastore.org/commitlintrc.json" - }, - { - "fileMatch": ["/.hadolint.yaml"], - "url": "https://raw.githubusercontent.com/hadolint/hadolint/master/contrib/hadolint.json" - }, - { - "fileMatch": ["/.pre-commit-config.yaml"], - "url": "https://json.schemastore.org/pre-commit-config.json" - }, - { - "fileMatch": ["/.yamllint.yaml"], - "url": "https://json.schemastore.org/yamllint.json" - } -], -``` - ## Network connections See [Network connections in Visual Studio Code]. ## Troubleshooting +### Blank window upon launch + +[Details and additional links][electron applications all crash upon launch]. + +It could be caused by a conflict between glibc and Electron's sandboxing or GPU related features. +Run VSCode with one or more of the following flags: + +- `--disable-gpu` +- `--disable-gpu-sandbox` + +If using MS Teams, also consider using `--no-sandbox`. + ### _No extensions found_ when running from source Check the `extensionsGallery` key in your fork's `product.json` file is using the official marketplace: @@ -134,6 +175,9 @@ and if not, change them. ## Sources - [Using extensions in compiled VSCode] +- [Recommending VSCode extensions within your Open Source projects] +- [VSCode (and some non-patched Electron applications) doesn't run after Tumbleweed update on Nvidia] +- [Electron applications all crash upon launch] +[electron applications all crash upon launch]: https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1944468 +[recommending vscode extensions within your open source projects]: https://tattoocoder.com/recommending-vscode-extensions-within-your-open-source-projects/ [using extensions in compiled vscode]: https://stackoverflow.com/questions/44057402/using-extensions-in-compiled-vscode#45291490 +[vscode (and some non-patched electron applications) doesn't run after tumbleweed update on nvidia]: https://www.reddit.com/r/openSUSE/comments/ptqlfu/psa_vscode_and_some_nonpatched_electron/