From 815d4ba836dc48d7e0d14c229d28fe77a6a93617 Mon Sep 17 00:00:00 2001 From: Karl Ostmo Date: Sun, 27 Aug 2023 18:02:37 -0700 Subject: [PATCH] document VS Code usage --- .vscode/settings.json | 13 +++++++++++++ editors/README.md | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..675476ca76 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,13 @@ +{ + "yaml.schemas": { + "https://raw.githubusercontent.com/swarm-game/swarm/feature/json-schema-fixes/data/schema/scenario.json": [ + "data/scenarios/**/*.yaml" + ], + "https://raw.githubusercontent.com/swarm-game/swarm/feature/json-schema-fixes/data/schema/entities.json": [ + "data/entities.yaml" + ], + "https://raw.githubusercontent.com/swarm-game/swarm/feature/json-schema-fixes/data/schema/recipes.json": [ + "data/recipes.yaml" + ], + } +} \ No newline at end of file diff --git a/editors/README.md b/editors/README.md index 824ba2a322..0d49c5ea83 100644 --- a/editors/README.md +++ b/editors/README.md @@ -29,6 +29,26 @@ You can get it by: - **TBD** get the VSIX from GitHub releases - **TBD** installing from the VS codium free marketplace +### YAML schema validation + +To configure JSON editor windows for schema validation, install the [YAML plugin](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) and add the following to `.vscode/settings.json` under the workspace root: + +```json +{ + "yaml.schemas": { + "https://raw.githubusercontent.com/swarm-game/swarm/feature/json-schema-fixes/data/schema/scenario.json": [ + "data/scenarios/**/*.yaml" + ], + "https://raw.githubusercontent.com/swarm-game/swarm/feature/json-schema-fixes/data/schema/entities.json": [ + "data/entities.yaml" + ], + "https://raw.githubusercontent.com/swarm-game/swarm/feature/json-schema-fixes/data/schema/recipes.json": [ + "data/recipes.yaml" + ], + } +} +``` + ## Vim and Neovim Currently there is neither highlighting nor LSP support for Vim,