Editor setup (Prisma ORM v7)
Learn how to configure your editor and IDEs for syntax highlighting, autocompletion, and formatting with Prisma ORM
This page describes how to configure your editor for syntax highlighting, autocompletion, and formatting of Prisma schema files.
If you don't see your editor here, please open a feature request" and ask for dedicated support for your editor (e.g. for syntax highlighting and auto-formatting).
VS Code extension
Section titled “VS Code extension”You can install the official Prisma VS Code extension. It adds extra capabilities to VS Code when developing applications with Prisma ORM:
- 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+Spaceshortcut.
- 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.jsonfile:JSON "editor.formatOnSave": true - To enable formatting in combination with
prettier, add the following to yoursettings.jsonfile:or use the Prettier plugin for PrismaJSON "[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
F2and then type the new desired name and pressEnter - All usages will be renamed
- Automatically applies
@mapor@@mapon 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
Community projects
Section titled “Community projects”Note: Community projects are not maintained or officially supported by Prisma and some features may by out of sync. Use at your own discretion.
- emacs-prisma-mode provides syntax highlighting of the Prisma Schema Language and uses the Prisma Language Server.
- vim-prisma provides file detection and syntax highlighting of the Prisma Schema Language.
neovim
Section titled “neovim”- coc-prisma implements the Prisma Language Server.
JetBrains IDE
Section titled “JetBrains IDE”- Prisma ORM Provided by JetBrains. This plugin provides PSL grammar, syntax highlighting, LSP, and more.
Sublime Text
Section titled “Sublime Text”- Prisma - For Sublime Text 3 & 4 - Provides syntax highlighting for the Prisma Schema Language. (Source Code)
- LSP-prisma - For Sublime Text 4 - Language Server helper package for Prisma schema files that uses Prisma's Language Server to provide linting, error checking, formatting, autocompletion, renaming etc. Note: It requires the Prisma package to be installed. (Source Code)
- nova provides syntax highlighting of the Prisma Schema Language and uses the Prisma Language Server.
- Helix (from version 22.08) provides syntax highlighting of the Prisma Schema Language and uses the Prisma Language Server.
CLI autocomplete
Section titled “CLI autocomplete”inshellisense
Section titled “inshellisense”You can get IDE-style autocompletion for Prisma CLI using inshellisense. It supports: bash, zsh, fish, pwsh, powershell (Windows Powershell).
To install, run:
bun add --global @microsoft/inshellisensepnpm add -g @microsoft/inshellisenseyarn global add @microsoft/inshellisensenpm install -g @microsoft/inshellisense