Note: The language server implementation may be replaced with a new parser in the future. Focus on VS Code extension features for now.
| 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 |
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.