# Autocomplete in your editor

> Field names, allowed values and errors as you type, in VS Code or any editor that reads JSON Schema.

You want your editor to suggest field names and allowed values, and to underline a mistake before you run `alta lint`.

## Solution

Write the JSON Schemas into your project once:

```sh [Terminal]
alta schemas --out .alta/schemas
```

Then tell VS Code which schema goes with which file, in `.vscode/settings.json`:

```json [.vscode/settings.json]
{
  "json.schemas": [
    {
      "fileMatch": [
        "quests.json",
        "*.quests.json",
        "mission.json"
      ],
      "url": "./.alta/schemas/alta.quests.schema.json"
    },
    {
      "fileMatch": ["chart.json"],
      "url": "./.alta/schemas/alta.chart.schema.json"
    },
    {
      "fileMatch": ["onboarding.json"],
      "url": "./.alta/schemas/alta.onboarding.schema.json"
    },
    {
      "fileMatch": ["cinematics.json"],
      "url": "./.alta/schemas/alta.cinematics.schema.json"
    }
  ]
}
```

Open `quests.json`: typing `"kind": "` lists the step kinds, and a misspelled field is underlined.

## How it works

`alta schemas` writes one JSON Schema per standard, the same ones `alta lint` and the SDK use. The `json.schemas` setting maps file names to these schemas, so you need nothing inside your content files. The schemas catch the shape of a file (names, types, closed lists); `alta lint` still does the rest, such as references between quests.

## Variants

- **Other editors.** JetBrains IDEs: *Settings › Languages & Frameworks › Schemas and DTDs › JSON Schema Mappings*, with the same files. Neovim and Helix: give the same mapping to the JSON language server.
- **Keep them current.** Run `alta schemas --out .alta/schemas` again after you update `alta`; `alta schemas --out .alta/schemas --check` fails if they are out of date.
- **Other file names.** Add your names to `fileMatch`, for example `"*.quests.json"`.

**Next:**

- [alta schemas](https://docs.altasystem.ai/reference/cli/schemas)
- [Check a repository in GitHub Actions](https://docs.altasystem.ai/recipes/ci-github-actions)
