/vscode

VSCode extension adding syntax highlighting, formatting, auto-completion, jump-to-definition and linting for .prisma files.

Primary LanguageTypeScriptApache License 2.0Apache-2.0

vscode

Adds syntax highlighting, formatting, jump-to-definition and linting for .prisma files.

This plugin is designed for Prisma 2. Information about the new datamodel syntax can be found here.

Features

  • Syntax highlighting
  • Auto-formatting
  • Linting
  • Jump-to-definition
  • Auto-completion (coming soon)

It also includes an End-to-End test.

Install

Preview

Structure

.
--- client // Language Client
|   --- src
|       --- extension.ts // Language Client entry point
--- package.json // The extension manifest
--- server // Language Server
    --- src
        --- server.ts // Language Server entry point

Development

  • Run npm install in this folder. This installs all necessary npm modules in both the client and server folder.
  • Run yarn watch.
  • Open VS Code on this folder.
  • Switch to the debug viewlet.
  • Select Launch Client from the drop down.
  • Run the launch config.
  • If you want to debug the server as well use the launch configuration Attach to Server afterwards or select the launch configuration Client + Server at once.
  • A new file should open in the [Extension Development Host] instance of VSCode.
  • Change the language to Prisma.
  • Make a change to the syntax
  • To reload, press the reload button in VSCode ( Developer: Inspect TM Scopes is helpful for debugging syntax issues )

Testing

Instructions on manual testing can be found here.

End-to-End tests:

  • Run npm install in this folder.
  • Open VS Code on this folder.
  • Switch to the debug viewlet.
  • Select Language Server E2E Test from the drop down.
  • Run the launch config.
  • Open the debug console to view the test results.

Publishing

The extension is automatically published using a Azure Devops Personal Access Token via Github actions (see .github/workflows/publish.yml).

Note that the personal access token is only valid for a year and will need to be renewed manually.

Manual Publishing

To do a manual publish, please follow these steps:

  1. Increment the package version
  2. Update to latest pinned binary release in the Prisma CLI's package.json under prisma.version.
  3. Run yarn package
  4. Go to https://marketplace.visualstudio.com/manage/publishers/Prisma
  5. Click the ��� More Actions
  6. Drag prisma-x.x.x.vsix into the browser and click upload.

This will take about an hour before the update is available.