Skip to content

Latest commit

 

History

History

vscode

Prisma VS Code Extension

Version Installs Ratings


Adds syntax highlighting, formatting, jump-to-definition and linting for [Prisma Schema](https://www.prisma.io/docs/concepts/components/prisma-schema) files.

VS Code Marketplace

You can find both the stable and Insider extension on the Marketplace.

Open VSX Registry

You can find both the stable and Insider extension on the Open VSX Registry.

Features

  • 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.
  • Symbols for schema blocks datasourcegeneratormodelenum and type
  • Documentation help
    • Documentation of a completion result pops up as completion results are provided.
  • Quick info on hover
    • Documentation Comments (///) of model, enum or type appear anywhere you hover over their usages.
    • CMD + hover on a field whose type is a model, enum or type will show the corresponding block in a popup.
  • Go to Definition
    • Jump to or peek a model, enum or type definition. (CMD + left click)
  • 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 your settings.json file:
        "[prisma]": {
          "editor.defaultFormatter": "Prisma.prisma"
        },
        
        or use the Prettier plugin for Prisma
  • Rename
    • Rename models, enums, fields and enum values
      • Click into the model or enum, press F2 and then type the new desired name and press Enter
      • All usages will be renamed
      • Automatically applies @map or @@map on the schema
  • Quick-fixes
    • Quickly fix typos in model and enum names
    • Create new models and enums with a single click
    • Add @unique on model fields for a @relation where the references value is pointing to a field missing it.

Preview

Syntax-Highlighting

Syntax highlighting eases visual comprehension of the Prisma schema. Preview Schema

Formatting

Formatting ensures consistent indentation of your models for better readability. Formatting

Linting and autocompletion

Linting shows inline errors in the schema, and autocompletion assists in defining the correct type. Linting and autocompletion

Contextual suggestions

Contextual suggestions assist in defining field types, models, and relations while formatting automatically defines back relations. Contextual suggestions

Jump-to-definition

Easily navigate definitions, i.e. models in the Prisma schema.

Jump-to-definition

Contributing

Read more about how to contribute to the Prisma VS Code extension

Security

If you have a security issue to report, please contact us at security@prisma.io

Build Status

  • E2E Tests Status

    E2E tests after release on VSIX

    E2E tests before Insider release