-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Labels
bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.Bug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.A reported bug.topic: editorsEditors other than VS CodeEditors other than VS Codetopic: language server
Description
Bug description
Since #1828 (@prisma/language-server >= "6.8.0") prisma-language-server crashes on startup with an empty settings -- or more specifically, any settings which does not provide enableDiagnostics.
How to reproduce
Steps to reproduce the behavior:
- Launch Zed
- Install Zed Prisma extension v0.1.0
- Open a .prisma file
- From the command palette (cmd-shift-p) spawn
dev: language server logs - Select 'prisma-language-server' from the dropdown
- In the server-logs, note:
Default version of Prisma 'prisma-schema-wasm': 2060c79ba17c6bb9f5823312b6f6b7f4a845738e
Extension name @prisma/language-server with version 6.8.2
Prisma Engines version: 6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e
Prisma CLI version: 6.8.2
Configuration changed.
/Users/peter/Library/Application Support/Zed/extensions/work/prisma/node_modules/@prisma/language-server/dist/server.js:151
if (settings.enableDiagnostics === false) {
^
TypeError: Cannot read properties of null (reading 'enableDiagnostics')
at validateTextDocument (/Users/peter/Library/Application Support/Zed/extensions/work/prisma/node_modules/@prisma/language-server/dist/server.js:151:22)
at async /Users/peter/Library/Application Support/Zed/extensions/work/prisma/node_modules/@prisma/language-server/dist/server.js:162:9
Node.js v23.11.0
Workaround is to explicitly provide "enableDiagnostics": true via LSP settings.
Expected behavior
prisma-language-server does not crash with empty settings.
Prisma information
language-tools/packages/language-server/src/server.ts
Lines 157 to 160 in 2390773
| if (settings.enableDiagnostics === false) { | |
| await connection.sendDiagnostics({ uri: textDocument.uri, diagnostics: [] }) | |
| return | |
| } |
Environment & setup
- OS: macOS
- Editor: Zed
- Editor version: v0.189.x nightly, Prisma extension v0.1.0.
- @prisma/language-server: "6.8.2"
ccssmnn, remorses and 4nduril
Metadata
Metadata
Assignees
Labels
bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.Bug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.A reported bug.topic: editorsEditors other than VS CodeEditors other than VS Codetopic: language server