Agent Guide for Prisma Language Tools

December 5, 2025 · View on GitHub

This document helps AI coding agents understand and work effectively in this repository.

Project Overview

This is the Prisma Language Tools monorepo—the official VS Code extension and Language Server for Prisma, the popular TypeScript ORM. The extension provides IDE features for .prisma schema files: syntax highlighting, completions, formatting, diagnostics, hover information, go-to-definition, and more.

Packages

PackagePathPurpose
@prisma/language-serverpackages/language-serverLSP implementation
prisma (VS Code ext)packages/vscodeVS Code extension with plugins

Documentation

DocumentDescription
ArchitectureSystem design and file organization
DevelopmentSetup and debugging instructions
Build Systemesbuild bundling and static assets
Plugin SystemVS Code extension plugin architecture
Language ServerLSP implementation details
Local Prisma PostgresLocal dev server and worker process
TestingTest patterns and helpers
Common TasksHow to add features
CI/CDGitHub Actions workflows
GotchasImportant tips and warnings

Quick Start

# Install all dependencies (uses pnpm workspaces)
pnpm install

# Build TypeScript
pnpm build

# Watch mode for development
pnpm watch

Then press F5 in VS Code to launch the extension in debug mode.

Available Commands

CommandDescription
pnpm buildBuild all packages
pnpm watchWatch mode
pnpm testRun unit tests in all packages (via Turborepo)
pnpm test:e2eRun VS Code E2E tests
pnpm lintLint all packages
pnpm typecheckType-check all packages with TypeScript
pnpm cleanRemove untracked files and directories (incl node_modules)

Commands are orchestrated by Turborepo. See turbo.json for task dependencies.

Key Points

  • Plugin-based architecture — The VS Code extension uses a plugin system. See Plugin System for details.

  • Multi-file schema support — Prisma schemas can span multiple files. Always use PrismaSchema.load() instead of assuming a single file.

  • Language server may change — The LS implementation may be replaced with a new parser. Focus on VS Code extension features for now.

  • Dependencies auto-update — Don't manually bump @prisma/* packages. CI handles this via cron jobs.

  • Test cursor convention — Tests use | to mark cursor position for testing completions, hover, etc.

  • Keep documentation up to date — When making changes to the codebase, update relevant documentation in the docs/ folder and any README files. If you add new features, modify architecture, or change workflows, ensure the corresponding docs reflect those changes.