To get validation and autocompletion of Spack configuration files, enable an extension for the YAML Language Server Protocol (LSP) in your editor of choice.
- Visual Studio Code: Install the YAML Language Support extension by Red Hat.
Then add the following line at the top of your YAML file:
# yaml-language-server: $schema=https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/spack.json
# yaml-language-server: $schema=https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/packages.json
# yaml-language-server: $schema=https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/config.json
# yaml-language-server: $schema=https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/modules.json
# yaml-language-server: $schema=https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/mirrors.json
# yaml-language-server: $schema=https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/concretizer.json
# yaml-language-server: $schema=https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/ci.json