Skip to content

Latest commit

 

History

History
85 lines (63 loc) · 4.11 KB

File metadata and controls

85 lines (63 loc) · 4.11 KB

Agent Guide for Prisma Language Tools

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

Package Path Purpose
@prisma/language-server packages/language-server LSP implementation
prisma (VS Code ext) packages/vscode VS Code extension with plugins

Documentation

Document Description
Architecture System design and file organization
Development Setup and debugging instructions
Build System esbuild bundling and static assets
Plugin System VS Code extension plugin architecture
Language Server LSP implementation details
Local Prisma Postgres Local dev server and worker process
Testing Test patterns and helpers
Common Tasks How to add features
CI/CD GitHub Actions workflows
Gotchas Important 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

Command Description
pnpm build Build all packages
pnpm watch Watch mode
pnpm test Run unit tests in all packages (via Turborepo)
pnpm test:e2e Run VS Code E2E tests
pnpm lint Lint all packages
pnpm typecheck Type-check all packages with TypeScript
pnpm clean Remove 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.