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,