# Editor support (/docs/orm/contract-authoring/editor-support)

What the Prisma VS Code extension does for a Prisma ORM contract, and what to do when it stops accepting the file.

Location: ORM > Contract authoring > Editor support

Install the [Prisma VS Code extension](https://marketplace.visualstudio.com/items?itemName=Prisma.prisma) to get error checking, formatting, and completion in your `.prisma` file.

In Prisma ORM 8 that file is the [data contract](/guides/contract-authoring-the-data-contract): the description of your models that Prisma ORM 7 called the schema. Its path is the `contract` setting in your `prisma.config.ts`, which is `prisma/contract.prisma` in the config [`orm init`](/guides/orm-orm-init) writes; see [Configuration](/guides/introduction-6-configuration#config-file).

Coming from Prisma ORM 7? Start with [Coming from Prisma ORM 7](/guides/introduction-2-orm-coming-from-prisma-orm-7). This page covers VS Code only.

## The file header

The extension only works on `.prisma` files whose first non-blank line is:

```prisma title="prisma/contract.prisma"
// use prisma-8
```

A file without that line gets no error checking, no completion, and no formatting. [`prisma contract emit`](/guides/orm-contract-emit) also skips it without a warning, and when none of the files that the `contract` setting names has the line, `contract emit` fails with `CONTRACT.SOURCE_LOAD_FAILED`. [`orm init`](/guides/orm-orm-init) and [`contract infer`](/guides/orm-contract-infer) write the line for you. Add it yourself when you create a contract by hand.

## What the editor does

- **Errors** appear inline as you type. They are the same errors you would get from [`prisma contract emit`](/guides/orm-contract-emit), the command that checks the contract and writes `contract.json` and `contract.d.ts`.
- **Formatting** reformats the whole file. In VS Code, run **Format Document**.
- **Completion** starts when you type `@` or `@@`. The editor lists attribute names such as `@id`, `@default`, and `@@index`, each with a short description. Inside an attribute, it lists the names of the arguments you have not filled in yet and suggests values for them. It also suggests values inside `[ ]` and `{ }`. In a MongoDB index's field list, it suggests the option and its values in the parentheses after a field name, such as `sort` and `Desc` in `@@index([createdAt(sort: Desc)])`. Where an attribute expects a field name, it suggests only scalar fields. When an attribute has required arguments, VS Code inserts them as placeholders named after each argument, which you tab through.
- **Signature help** appears when you type `(` or `,` inside an attribute. It shows the attribute's arguments and describes the one you are typing.

The list of attributes comes from your `prisma.config.ts`: the database it declares and the Prisma extension packs listed under `extensions`; see [Extension packs](/guides/introduction-6-configuration#extension-packs) for that config. Extension packs are add-on packages for database features such as [pgvector](/guides/extensions-using-extensions). If your config lists the pgvector pack, the editor also suggests pgvector's attributes. No database connection is needed.

## False errors after an upgrade

If the editor marks attributes as errors in a contract that `prisma contract emit` accepts, the likely cause is an old ORM package. That is the `@prisma/orm-postgres`, `@prisma/orm-mongo`, or `@prisma/orm-sqlite` package your project installs for its database. Check the installed version:

```bash title="Terminal"
npm ls @prisma/orm-postgres
```

If it prints a version below `8.0.0-rc.9`, update it to the current release:

#### bun

```bash title="Terminal"
bun add @prisma/orm-postgres@latest
```

#### pnpm

```bash title="Terminal"
pnpm add @prisma/orm-postgres@latest
```

#### yarn

```bash title="Terminal"
yarn add @prisma/orm-postgres@latest
```

#### npm

```bash title="Terminal"
npm install @prisma/orm-postgres@latest
```

Replace `orm-postgres` with `orm-mongo` or `orm-sqlite` to match your database. Then reload the editor window. In VS Code, run **Developer: Reload Window** from the Command Palette.

## Related pages

- [`Author in PSL`](/guides/contract-authoring-psl-syntax): Write the Prisma ORM contract in the Prisma schema language you already know, plus the Prisma ORM 8 additions.
- [`Author in TypeScript`](/guides/contract-authoring-typescript-schema-builder): Define the Prisma ORM contract with a typed builder in TypeScript instead of a schema file. Same models, same `contract.json` and `contract.d.ts`, no separate language.
- [`contract.json and contract.d.ts`](/guides/contract-authoring-the-contract-artifact): contract.json and contract.d.ts are the two files every other part of Prisma ORM reads. Here is what is inside them.
- [`Supported database features`](/guides/contract-authoring-capabilities): The contract records which database features your packages support, so Prisma ORM can reject an unsupported one early with a clear error.
- [`The data contract`](/guides/contract-authoring-the-data-contract): The data contract is the one description of your data model and how it is stored. Prisma ORM types your queries, plans your migrations, and checks your database against it.

## Related pages

- [Authentication & Tools](./authentication-tools-index.md)
- [Build](./build-index.md)
- [Changelog](../changelog.md)
- [Concepts](./concepts-index.md)
- [Console commands](./console-commands-index.md)
- [Contract Authoring](./contract-authoring-index.md)
- [Core Concepts](./core-concepts-index.md)
- [Data Modeling](./data-modeling-index.md)
- [Database](./database-index.md)
- [DB commands](./db-commands-index.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
