Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 1.28 KB

File metadata and controls

35 lines (26 loc) · 1.28 KB

Language Server Architecture

Note: The language server implementation may be replaced with a new parser in the future. Focus on VS Code extension features for now.

Key Files

File Purpose
src/server.ts Entry point, sets up LSP connection
src/lib/MessageHandler.ts Dispatches LSP requests
src/lib/Schema.ts PrismaSchema class for multi-file schemas
src/lib/prisma-schema-wasm/ Wrappers around the WASM parsing module

Multi-File Schema Support

Prisma supports splitting schemas across multiple .prisma files. The PrismaSchema class handles this:

// Loading a schema (handles both single and multi-file)
const schema = await PrismaSchema.load({
  currentDocument: textDocument,
  allDocuments: documents.all(),
})

// Iterating over all lines across files
for (const line of schema.iterLines()) {
  // line.document, line.lineIndex, line.text
}

See Prisma Multi-File Schema Documentation for details.