> ## Documentation Index
> Fetch the complete documentation index at: https://lightdash-refactor-full-audit-reorg.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up VS Code for Lightdash

> Configure YAML validation in VS Code so schema and formatting issues in your Lightdash model, chart, and dashboard files are flagged as you edit.

## YAML validation

If you edit your Lightdash YAML in VS Code — dbt model schema files, or charts and dashboards managed as [content as code](/workflow/content-as-code) — set up schema validation so formatting and configuration issues are flagged before you compile or upload. You get autocomplete for supported properties and inline errors for invalid ones, using the same logic Lightdash applies when compiling your project.

<Steps>
  <Step title="Install the YAML extension">
    Install the [YAML extension for VS Code](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml).
  </Step>

  <Step title="Map the Lightdash schemas in settings.json">
    Add the schemas to your `settings.json` file. [Read this guide](https://code.visualstudio.com/docs/getstarted/settings#%5Fsettings-json-file) for details on how to edit `settings.json`.

    ```json settings.json theme={null}
    "yaml.schemas": {
      "https://raw.githubusercontent.com/lightdash/lightdash/main/packages/common/src/schemas/json/lightdash-dbt-2.0.json": [
        "/**/models/**/*.yml",
        "/**/models/**/*.yaml"
      ],
      "https://raw.githubusercontent.com/lightdash/lightdash/main/packages/common/src/schemas/json/chart-as-code-1.0.json": [
        "lightdash/charts/*.yml"
      ],
      "https://raw.githubusercontent.com/lightdash/lightdash/main/packages/common/src/schemas/json/dashboard-as-code-1.0.json": [
        "lightdash/dashboards/*.yml"
      ]
    }
    ```

    <Note>
      Adjust the chart and dashboard globs to match where you write content as code. The defaults above assume `lightdash download` wrote to `lightdash/charts/` and `lightdash/dashboards/`.
    </Note>
  </Step>
</Steps>

Once the extension is installed and your settings are updated, you'll see warnings like this when working on your `schema.yml` files.

<Frame>
  <img src="https://mintcdn.com/lightdash-refactor-full-audit-reorg/fyNjhJAU0n2GM0Ea/images/workflow/set-up-vs-code/vs-code-error-799eb7e9b48916f2f57100a0c87095e4.png?fit=max&auto=format&n=fyNjhJAU0n2GM0Ea&q=85&s=6f23696b5b13ef2364353cd6942cf77e" width="2326" height="836" data-path="images/workflow/set-up-vs-code/vs-code-error-799eb7e9b48916f2f57100a0c87095e4.png" />
</Frame>
