Skip to content

feat(lsp): add Prisma Language Server support#23

Merged
amondnet merged 6 commits into
mainfrom
22-featlsp-add-prisma-language-server-support
Dec 18, 2025
Merged

feat(lsp): add Prisma Language Server support#23
amondnet merged 6 commits into
mainfrom
22-featlsp-add-prisma-language-server-support

Conversation

@amondnet

Copy link
Copy Markdown
Contributor

Summary

Add support for the Prisma Language Server (@prisma/language-server) to @pleaseai/code-lsp package, enabling LSP features for .prisma schema files.

Changes

  • Add PrismaServer definition with auto-download support
  • Add setupPrismaDependencies() function for npm-based installation
  • Add .prisma language mapping
  • Add comprehensive unit tests
  • Update documentation

Features

  • Auto-download: Automatically installs @prisma/language-server@31.1.35 to ~/.cache/dora/prisma-lsp/
  • Version tracking: Uses version marker file for tracking installed version
  • Root detection: Detects Prisma projects via schema.prisma or prisma/schema.prisma
  • LSP capabilities: Diagnostics, completions, hover, go-to-definition, formatting, code actions, rename, document symbols

Test Plan

  • Unit tests for PrismaServer (ID, extensions, root detection, spawn signature)
  • Root detection tests (schema.prisma, prisma/schema.prisma, monorepo)
  • getServersForExtension test for .prisma
  • TypeScript type check passes
  • All existing tests pass

Closes #22

Add support for the Prisma Language Server (@prisma/language-server) to
@pleaseai/code-lsp package, enabling LSP features for .prisma files.

Features:
- Auto-download via npm to ~/.cache/dora/prisma-lsp/
- Version tracking with marker file
- Root detection via schema.prisma or prisma/schema.prisma
- Supports diagnostics, completions, hover, go-to-definition, formatting,
  code actions, rename, and document symbols

Closes #22
@amondnet amondnet linked an issue Dec 18, 2025 that may be closed by this pull request
8 tasks
@codecov

codecov Bot commented Dec 18, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 10.13825% with 195 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.09%. Comparing base (e9ec0e1) to head (63d960b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/lsp/src/server.ts 6.56% 185 Missing ⚠️
packages/format/src/formatter.ts 44.44% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
- Coverage   34.68%   33.09%   -1.60%     
==========================================
  Files          13       13              
  Lines        2606     2798     +192     
==========================================
+ Hits          904      926      +22     
- Misses       1702     1872     +170     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Add Prisma Language Server with auto-download support
- Add Dart language server (was missing from root README)
- Add Vue language server (was missing from root README)
- Add prisma formatter with `bun x prisma format --schema $FILE`
- Enable when schema.prisma or prisma/schema.prisma exists
- Update documentation in README.md and CLAUDE.md
- Document supported formatters with auto-detection
- Add configuration examples (dora.json, opencode.json)
- Include API reference and usage examples
- Mark all phases as completed in tasklist.json
- Add pre-approved tool permissions to settings.json
- Fix empty catch blocks in nearestRoot() to check for ENOENT specifically
- Fix empty catch block in DenoServer.root() for consistent error handling
- Add attachLSPProcessHandlers to TypeScript, Deno, Pyright, Gopls,
  RustAnalyzer, and Oxlint servers for better process lifecycle logging
- Add error handling for bunx fallback in TypeScript and Pyright servers
- Fix misleading test name "returns projectPath when no schema found"
  to "detects schema.prisma at project root"
@amondnet
amondnet merged commit 9a691e1 into main Dec 18, 2025
6 of 9 checks passed
@passionfactory-bot passionfactory-bot Bot mentioned this pull request Dec 18, 2025
@amondnet
amondnet deleted the 22-featlsp-add-prisma-language-server-support branch December 18, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(lsp): Add Prisma Language Server support

1 participant