Adds syntax highlighting, formatting, jump-to-definition and linting for [Prisma Schema](https://www.prisma.io/docs/concepts/components/prisma-schema) files.
You can find both the stable and Insider extension on the Marketplace.
You can find both the stable and Insider extension on the Open VSX Registry.
- Syntax highlighting of
schema.prisma
- Linting
- Diagnostic tools are used to surface errors and warnings in your schema file as you type.
- Code Completion
- Completion results appear for symbols as you type.
- You can trigger this manually with the
Ctrl+Space
shortcut.
- Documentation help
- Documentation of a completion result pops up as completion results are provided.
- Quick info on hover
- Documentation Comments (
///
) of models and enums appear anywhere you hover over their usages.
- Documentation Comments (
- Go to Definition
- Jump to or peek a model or enum's declaration.
- Formatting
- Format code either manually or on save (if configured).
- To automatically format on save, add the following to your
settings.json
file:"editor.formatOnSave": true
- To enable formatting in combination with
prettier
, add the following to yoursettings.json
file:or use the Prettier plugin for Prisma"[prisma]": { "editor.defaultFormatter": "Prisma.prisma" },
- To automatically format on save, add the following to your
- Format code either manually or on save (if configured).
- Rename
- Rename models, enums, fields and enum values
- Click into the model or enum, press
F2
and then type the new desired name and pressEnter
- All usages will be renamed
- Automatically applies
@map
or@@map
on the schema
- Click into the model or enum, press
- Rename models, enums, fields and enum values
- Quick-fixes
- Quickly fix typos in model and enum names
- Create new models and enums with a single click
Linting and autocompletion
Linting shows inline errors in the schema, and autocompletion assists in defining the correct type.
Contextual suggestions
Contextual suggestions assist in defining field types, models, and relations while formatting automatically defines back relations.
Read more about how to contribute to the Prisma VS Code extension
If you have a security issue to report, please contact us at security@prisma.io