Skip to content

TML-2934: surface PSL symbol-table diagnostics in the language server#862

Merged
SevInf merged 3 commits into
mainfrom
lsp-diagnostic-extend
Jun 23, 2026
Merged

TML-2934: surface PSL symbol-table diagnostics in the language server#862
SevInf merged 3 commits into
mainfrom
lsp-diagnostic-extend

Conversation

@SevInf

@SevInf SevInf commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Extends @prisma-next/language-server so configured PSL documents publish both parse diagnostics and symbol-table diagnostics from the in-memory editor buffer, while preserving parser outputs for future LSP features.

Changes

  • Diagnostics pipeline: Adds a reusable runPipeline path that parses the current document text, builds a symbol table with config-derived PSL inputs, and publishes parse diagnostics before symbol-table diagnostics.
  • Project state: Tracks ASTs per document URI and one symbol table per project/config, so later LSP features such as completion or semantic tokens can reuse the same parsed state instead of recomputing from disk.
  • Config integration: Resolves PSL schema inputs and control-stack inputs from prisma-next.config.ts; configured PSL projects fail fast on invalid stack creation instead of silently falling back to parse-only diagnostics.
  • LSP lifecycle: Keeps main branch formatter support, refreshes project state on config changes, clears document ownership on close, and guards async publishes so stale document work cannot recreate artifacts after a close or edit.
  • Config typing: Exposes and uses PrismaNextConfig from @prisma-next/config-loader instead of inferring the loaded config type from loadConfig.

Why

The language server needs intermediate parser and symbol-table stages for diagnostics now and for richer editor features later. Running those stages directly against the open document keeps diagnostics accurate for unsaved edits, avoids interpretation work that is out of scope for this PR, and lets the server preserve the AST/symbol table shape it will need for future LSP capabilities.

Validation

  • pnpm --filter @prisma-next/language-server typecheck
  • pnpm --filter @prisma-next/language-server test — 74 tests
  • pnpm --filter @prisma-next/language-server lint
  • pnpm lint:deps

Closes TML-2934.

@SevInf SevInf requested a review from a team as a code owner June 22, 2026 15:02
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Extends the language server with optional control-stack resolution, a unified parse-plus-symbol-table diagnostics pipeline, per-document AST caching with a per-project symbol table, and server accessors for cached artifacts. All artifacts are initialized, updated, and cleaned up across document lifecycle events.

Changes

PSL Diagnostics Pipeline and Artifact Caching

Layer / File(s) Summary
Pipeline contracts and helpers
packages/1-framework/3-tooling/language-server/package.json, src/pipeline.ts, src/schema-inputs.ts
Adds PipelineInputs and PipelineResult contracts, implements runPipeline for ordered parse-then-symbol-table diagnostics with merging, introduces hasPslInputs helper, and adds the @prisma-next/framework-components dependency for control-stack access.
Config resolution with control stack
src/config-resolution.ts
ConfigResolution interface now carries controlStack: PipelineInputs as required alongside optional formatter; resolveConfigInputs derives control stack via resolveControlStackInputs(config) ?? emptyPipelineInputs; and resolveControlStackInputs builds control-stack inputs from Prisma config when PSL inputs exist.
Document diagnostics with pipeline support
src/document-diagnostics.ts
Introduces DocumentDiagnostics interface holding diagnostics, document, sourceFile, and symbolTable; computeDocumentDiagnostics now requires controlStack: PipelineInputs and returns `DocumentDiagnostics
Project artifact cache
src/project-artifacts.ts
Adds CachedDocument to store parsed document and source file, and ProjectArtifacts interface with per-URI document getters, project-scoped symbol-table getter, update, and remove operations; createProjectArtifacts() maintains in-memory per-URI caches and a single symbol table with lifecycle cleanup.
Server state and artifact management
src/server.ts
LanguageServer interface adds getDocumentAst(uri) and getProjectSymbolTable(uri) getters; ProjectState stores controlStack and artifacts; publish delegates to artifacts.update() with inputs and optional control stack; loadProject preserves artifacts across config reloads and initializes controlStack; and onDidClose removes the URI from artifacts before clearing diagnostics.
Config type re-export
packages/1-framework/3-tooling/config-loader/src/exports/index.ts
Publicly exports PrismaNextConfig type for downstream language-server and framework-components use.
README documentation
README.md
Updates "How it works" to describe parse-plus-symbol-table diagnostics merging; expands "Preserved artifacts" to cover per-URI AST, single project symbol table, and getter accessors; and updates "Module layout" to reflect control-stack resolution and the new project-artifacts module.
Config, pipeline, and document diagnostics tests
test/config-resolution.test.ts, test/pipeline.test.ts, test/document-diagnostics.test.ts
Config tests verify control-stack derivation and error handling; pipeline tests validate diagnostic merging order, robustness on malformed input, and artifact exposure; document-diagnostics tests cover parse-only and control-stack-enabled symbol-table diagnostics.
Project artifacts and server tests
test/project-artifacts.test.ts, test/server.test.ts
Project-artifacts tests cover per-URI caching, symbol-table rebuilding, lifecycle cleanup, and configuration invalidation; server tests validate end-to-end symbol-table diagnostics, artifact preservation across edits and closes, and cached artifact accessor integration.

Sequence Diagram(s)

sequenceDiagram
  participant Client as LSP Client
  participant Server as server.ts
  participant ConfigRes as resolveConfigInputs
  participant Artifacts as ProjectArtifacts
  participant Pipeline as runPipeline
  participant Parse as parse / buildSymbolTable

  Client->>Server: didOpen/didChange uri, text
  Server->>ConfigRes: loadProject configPath
  ConfigRes-->>Server: inputs, controlStack
  Server->>Artifacts: update uri, text, inputs, controlStack
  Artifacts->>Pipeline: runPipeline text, controlStack
  Pipeline->>Parse: parse text
  Parse-->>Pipeline: document, sourceFile, parseDiagnostics
  Pipeline->>Parse: buildSymbolTable document, sourceFile, ...
  Parse-->>Pipeline: symbolTable, symbolTableDiagnostics
  Pipeline-->>Artifacts: merged diagnostics, artifacts
  Artifacts-->>Server: diagnostics
  Server-->>Client: publishDiagnostics

  Client->>Server: didClose uri
  Server->>Artifacts: remove uri
  Artifacts-->>Server: artifact cache cleared
  Server-->>Client: clear diagnostics
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~70 minutes

Possibly related PRs

  • prisma/prisma-next#288: Introduces the control-stack assembly API (createControlStack) that this PR consumes in resolveControlStackInputs.
  • prisma/prisma-next#852: Related language-server changes to diagnostics computation and publication paths in the same codebase.

Suggested reviewers

  • wmadden

Poem

🐇 I hop through stacks and symbols bright,
Parse by day and cache by night.
One AST per URI I keep,
One table too, not lost in sleep.
Close the doc? I tidy clean—
Then leap ahead, a logic queen!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'TML-2934: surface PSL symbol-table diagnostics in the language server' clearly and specifically summarizes the main objective of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lsp-diagnostic-extend

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
packages/1-framework/3-tooling/language-server/src/config-resolution.ts (1)

21-26: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Consider using ifDefined for conditional object spread.

The conditional return could use ifDefined from @prisma-next/utils/defined for consistency with codebase patterns:

 export async function resolveConfigInputs(configPath: string): Promise<ConfigResolution> {
   const config = await loadConfig(configPath);
   const inputs = resolveSchemaInputs(config);
   const controlStack = resolveControlStackInputs(config);
-  return controlStack === undefined ? { inputs } : { inputs, controlStack };
+  return { inputs, ...ifDefined('controlStack', controlStack) };
 }

Based on learnings: prefer ifDefined from @prisma-next/utils/defined for conditional object spreads.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/1-framework/3-tooling/language-server/src/config-resolution.ts`
around lines 21 - 26, The resolveConfigInputs function uses a ternary operator
for conditional return statements instead of the ifDefined utility. Import
ifDefined from `@prisma-next/utils/defined` and refactor the return statement to
use object spread syntax with ifDefined helper for the controlStack property,
replacing the current ternary conditional pattern to maintain consistency with
codebase conventions.

Source: Learnings

packages/1-framework/3-tooling/language-server/src/server.ts (1)

132-135: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Consider using ifDefined for conditional object spread.

The conditional ProjectState construction could use ifDefined from @prisma-next/utils/defined for consistency:

   async function loadProject(configPath: string): Promise<ProjectState> {
     const resolution = await resolveConfigInputs(configPath);
-    const project: ProjectState =
-      resolution.controlStack === undefined
-        ? { configPath, inputs: resolution.inputs }
-        : { configPath, inputs: resolution.inputs, controlStack: resolution.controlStack };
+    const project: ProjectState = {
+      configPath,
+      inputs: resolution.inputs,
+      ...ifDefined('controlStack', resolution.controlStack),
+    };
     projects.set(configPath, project);
     return project;
   }

Based on learnings: prefer ifDefined from @prisma-next/utils/defined for conditional object spreads.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/1-framework/3-tooling/language-server/src/server.ts` around lines
132 - 135, The ProjectState object construction uses a ternary operator to
conditionally include the controlStack property. Replace this conditional
construction with an object spread pattern using ifDefined from
`@prisma-next/utils/defined`. First ensure ifDefined is imported from
`@prisma-next/utils/defined`, then refactor the ProjectState assignment to use
object spread with ifDefined applied to resolution.controlStack for consistency
with the codebase conventions. This maintains the same functionality while using
the preferred utility function for conditional property inclusion.

Source: Learnings

packages/1-framework/3-tooling/language-server/test/document-diagnostics.test.ts (1)

20-28: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Consider extracting shared test constants.

The duplicateModelSource constant is duplicated in server.test.ts (lines 384-392). Similarly, scalarTypes appears in both pipeline.test.ts and server.test.ts. While duplication in test files is acceptable, extracting these to a shared test helper (e.g., test/fixtures.ts) would improve maintainability if additional tests need the same data.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/1-framework/3-tooling/language-server/test/document-diagnostics.test.ts`
around lines 20 - 28, Extract the duplicateModelSource constant and scalarTypes
constant from the test files (document-diagnostics.test.ts, server.test.ts, and
pipeline.test.ts) into a shared test helper file such as test/fixtures.ts.
Create the fixtures file if it doesn't exist, move these shared constants into
it, and then update all test files that use these constants to import them from
the new fixtures file instead of defining them locally.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/1-framework/3-tooling/language-server/src/config-resolution.ts`:
- Around line 21-26: The resolveConfigInputs function uses a ternary operator
for conditional return statements instead of the ifDefined utility. Import
ifDefined from `@prisma-next/utils/defined` and refactor the return statement to
use object spread syntax with ifDefined helper for the controlStack property,
replacing the current ternary conditional pattern to maintain consistency with
codebase conventions.

In `@packages/1-framework/3-tooling/language-server/src/server.ts`:
- Around line 132-135: The ProjectState object construction uses a ternary
operator to conditionally include the controlStack property. Replace this
conditional construction with an object spread pattern using ifDefined from
`@prisma-next/utils/defined`. First ensure ifDefined is imported from
`@prisma-next/utils/defined`, then refactor the ProjectState assignment to use
object spread with ifDefined applied to resolution.controlStack for consistency
with the codebase conventions. This maintains the same functionality while using
the preferred utility function for conditional property inclusion.

In
`@packages/1-framework/3-tooling/language-server/test/document-diagnostics.test.ts`:
- Around line 20-28: Extract the duplicateModelSource constant and scalarTypes
constant from the test files (document-diagnostics.test.ts, server.test.ts, and
pipeline.test.ts) into a shared test helper file such as test/fixtures.ts.
Create the fixtures file if it doesn't exist, move these shared constants into
it, and then update all test files that use these constants to import them from
the new fixtures file instead of defining them locally.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 8922d94b-ff62-4d35-9962-0be871987485

📥 Commits

Reviewing files that changed from the base of the PR and between 524c016 and 145f5ed.

⛔ Files ignored due to path filters (7)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • projects/lsp-diagnostic-extend/plan.md is excluded by !projects/**
  • projects/lsp-diagnostic-extend/slices/symbol-table-diagnostics/manual-qa.md is excluded by !projects/**
  • projects/lsp-diagnostic-extend/slices/symbol-table-diagnostics/plan.md is excluded by !projects/**
  • projects/lsp-diagnostic-extend/slices/symbol-table-diagnostics/qa-run-report.md is excluded by !projects/**
  • projects/lsp-diagnostic-extend/slices/symbol-table-diagnostics/spec.md is excluded by !projects/**
  • projects/lsp-diagnostic-extend/spec.md is excluded by !projects/**
📒 Files selected for processing (10)
  • packages/1-framework/3-tooling/language-server/package.json
  • packages/1-framework/3-tooling/language-server/src/config-resolution.ts
  • packages/1-framework/3-tooling/language-server/src/document-diagnostics.ts
  • packages/1-framework/3-tooling/language-server/src/pipeline.ts
  • packages/1-framework/3-tooling/language-server/src/schema-inputs.ts
  • packages/1-framework/3-tooling/language-server/src/server.ts
  • packages/1-framework/3-tooling/language-server/test/config-resolution.test.ts
  • packages/1-framework/3-tooling/language-server/test/document-diagnostics.test.ts
  • packages/1-framework/3-tooling/language-server/test/pipeline.test.ts
  • packages/1-framework/3-tooling/language-server/test/server.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/1-framework/3-tooling/language-server/src/server.ts`:
- Around line 71-82: The publish function is vulnerable to race conditions
because it performs an asynchronous operation with await
resolveProjectForDocument(uri) but callers invoke it without waiting, allowing
stale publishes to overwrite cached artifacts or recreate them after documents
are closed. Add a guard condition after resolving the project that verifies the
document state hasn't changed (such as checking if the document is still open or
hasn't been replaced by a newer version) before proceeding with the
artifactsForConfig mutation. This prevents the update call and subsequent
mutations from executing on stale data.
- Around line 262-268: In the documents.onDidClose handler, the code removes
cached artifacts using projectArtifacts.get(configPath)?.remove(uri) but fails
to remove the URI entry from the documentConfigPaths map. This causes Line 98 to
trust stale config path mappings when documents are reopened after config
changes. Add a call to documentConfigPaths.delete(uri) after removing the
artifacts to ensure the URI-to-config mapping is cleared, forcing rediscovery of
the correct config path when the document is reopened.

In `@packages/1-framework/3-tooling/language-server/test/server.test.ts`:
- Around line 1072-1074: Replace the setTimeout-based synchronization approach
in the test with an event-based barrier by waiting for the expected second
diagnostics publish event instead of using await new Promise((resolve) =>
setTimeout(resolve, 0)). This ensures the test synchronization is deterministic
and tied to actual application behavior rather than arbitrary timing,
eliminating the flakiness caused by variable event loop scheduling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: d740e34e-bcd3-49ec-9ec1-943f1e674829

📥 Commits

Reviewing files that changed from the base of the PR and between 145f5ed and 9fdb250.

⛔ Files ignored due to path filters (1)
  • projects/lsp-diagnostic-extend/slices/symbol-table-diagnostics/spec.md is excluded by !projects/**
📒 Files selected for processing (9)
  • packages/1-framework/3-tooling/language-server/README.md
  • packages/1-framework/3-tooling/language-server/src/document-diagnostics.ts
  • packages/1-framework/3-tooling/language-server/src/pipeline.ts
  • packages/1-framework/3-tooling/language-server/src/project-artifacts.ts
  • packages/1-framework/3-tooling/language-server/src/server.ts
  • packages/1-framework/3-tooling/language-server/test/document-diagnostics.test.ts
  • packages/1-framework/3-tooling/language-server/test/pipeline.test.ts
  • packages/1-framework/3-tooling/language-server/test/project-artifacts.test.ts
  • packages/1-framework/3-tooling/language-server/test/server.test.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/1-framework/3-tooling/language-server/README.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/1-framework/3-tooling/language-server/test/pipeline.test.ts
  • packages/1-framework/3-tooling/language-server/src/pipeline.ts
  • packages/1-framework/3-tooling/language-server/test/document-diagnostics.test.ts

Comment thread packages/1-framework/3-tooling/language-server/src/server.ts Outdated
Comment thread packages/1-framework/3-tooling/language-server/src/server.ts
Comment thread packages/1-framework/3-tooling/language-server/test/server.test.ts Outdated

export const CONFIG_FILENAME = 'prisma-next.config.ts';

type LoadedConfig = Awaited<ReturnType<typeof loadConfig>>;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have specific type for that?

Rebase the language-server diagnostic work onto current main, preserving main formatter support while requiring the project control stack for PSL diagnostics.

The server now publishes parse plus symbol-table diagnostics, preserves per-URI ASTs and one project symbol table, and keeps the project artifacts on project state.

Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
@SevInf SevInf force-pushed the lsp-diagnostic-extend branch from 5681b65 to fbbb2df Compare June 23, 2026 14:51
@pkg-pr-new

pkg-pr-new Bot commented Jun 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

@prisma-next/extension-author-tools

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/extension-author-tools@862

@prisma-next/mongo-runtime

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-runtime@862

@prisma-next/family-mongo

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/family-mongo@862

@prisma-next/sql-runtime

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-runtime@862

@prisma-next/family-sql

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/family-sql@862

@prisma-next/extension-arktype-json

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/extension-arktype-json@862

@prisma-next/middleware-cache

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/middleware-cache@862

@prisma-next/mongo

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo@862

@prisma-next/extension-paradedb

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/extension-paradedb@862

@prisma-next/extension-pgvector

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/extension-pgvector@862

@prisma-next/extension-postgis

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/extension-postgis@862

@prisma-next/postgres

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/postgres@862

@prisma-next/sql-orm-client

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-orm-client@862

@prisma-next/sqlite

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sqlite@862

@prisma-next/extension-supabase

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/extension-supabase@862

@prisma-next/target-mongo

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/target-mongo@862

@prisma-next/adapter-mongo

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/adapter-mongo@862

@prisma-next/driver-mongo

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/driver-mongo@862

@prisma-next/contract

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/contract@862

@prisma-next/utils

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/utils@862

@prisma-next/config

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/config@862

@prisma-next/errors

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/errors@862

@prisma-next/framework-components

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/framework-components@862

@prisma-next/operations

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/operations@862

@prisma-next/ts-render

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/ts-render@862

@prisma-next/contract-authoring

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/contract-authoring@862

@prisma-next/ids

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/ids@862

@prisma-next/psl-parser

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/psl-parser@862

@prisma-next/psl-printer

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/psl-printer@862

@prisma-next/cli

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/cli@862

@prisma-next/cli-telemetry

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/cli-telemetry@862

@prisma-next/config-loader

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/config-loader@862

@prisma-next/emitter

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/emitter@862

@prisma-next/language-server

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/language-server@862

@prisma-next/migration-tools

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/migration-tools@862

prisma-next

npm i https://pkg.pr.new/prisma/prisma-next@862

@prisma-next/vite-plugin-contract-emit

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/vite-plugin-contract-emit@862

@prisma-next/mongo-codec

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-codec@862

@prisma-next/mongo-contract

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-contract@862

@prisma-next/mongo-value

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-value@862

@prisma-next/mongo-contract-psl

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-contract-psl@862

@prisma-next/mongo-contract-ts

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-contract-ts@862

@prisma-next/mongo-emitter

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-emitter@862

@prisma-next/mongo-schema-ir

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-schema-ir@862

@prisma-next/mongo-query-ast

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-query-ast@862

@prisma-next/mongo-orm

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-orm@862

@prisma-next/mongo-query-builder

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-query-builder@862

@prisma-next/mongo-lowering

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-lowering@862

@prisma-next/mongo-wire

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/mongo-wire@862

@prisma-next/sql-contract

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-contract@862

@prisma-next/sql-errors

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-errors@862

@prisma-next/sql-operations

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-operations@862

@prisma-next/sql-schema-ir

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-schema-ir@862

@prisma-next/sql-contract-psl

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-contract-psl@862

@prisma-next/sql-contract-ts

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-contract-ts@862

@prisma-next/sql-contract-emitter

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-contract-emitter@862

@prisma-next/sql-lane-query-builder

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-lane-query-builder@862

@prisma-next/sql-relational-core

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-relational-core@862

@prisma-next/sql-builder

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/sql-builder@862

@prisma-next/target-postgres

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/target-postgres@862

@prisma-next/target-sqlite

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/target-sqlite@862

@prisma-next/adapter-postgres

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/adapter-postgres@862

@prisma-next/adapter-sqlite

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/adapter-sqlite@862

@prisma-next/driver-postgres

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/driver-postgres@862

@prisma-next/driver-sqlite

npm i https://pkg.pr.new/prisma/prisma-next/@prisma-next/driver-sqlite@862

commit: 401fe91

@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
postgres / no-emit 155.17 KB (0%)
postgres / emit 142.76 KB (0%)
mongo / no-emit 78 KB (0%)
mongo / emit 72.09 KB (0%)
cf-worker / no-emit 182.53 KB (0%)
cf-worker / emit 168.51 KB (0%)

Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/1-framework/3-tooling/language-server/test/document-diagnostics.test.ts (1)

49-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Deduplicate the repeated non-configured-input null test.

Line 49-53 and Line 95-100 assert the same contract (computeDocumentDiagnostics(...) returns null for an unconfigured URI). Keeping one case (or changing one to a distinct edge case) will reduce noise and improve failure clarity.

♻️ Suggested simplification
-  it('returns null for a document that is not a configured input', () => {
-    const otherUri = pathToFileURL('/abs/not-a-schema.psl').toString();
-    expect(
-      computeDocumentDiagnostics(otherUri, duplicateModelSource, inputs, controlStack),
-    ).toBeNull();
-  });

As per coding guidelines, **/*.{test,spec}.{ts,tsx,js,jsx}: Keep tests concise; omit 'should': .agents/rules/omit-should-in-tests.mdc.

Also applies to: 95-100

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/1-framework/3-tooling/language-server/test/document-diagnostics.test.ts`
around lines 49 - 53, Remove the duplicate test case for the
non-configured-input scenario. The test at lines 49-53 and the test at lines
95-100 both verify that computeDocumentDiagnostics returns null for an
unconfigured URI, which is redundant. Keep one of these test cases and either
delete the other or replace it with a distinct edge case test to improve test
clarity and reduce noise in the test suite.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@packages/1-framework/3-tooling/language-server/test/document-diagnostics.test.ts`:
- Around line 49-53: Remove the duplicate test case for the non-configured-input
scenario. The test at lines 49-53 and the test at lines 95-100 both verify that
computeDocumentDiagnostics returns null for an unconfigured URI, which is
redundant. Keep one of these test cases and either delete the other or replace
it with a distinct edge case test to improve test clarity and reduce noise in
the test suite.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 6830e109-f834-4780-8885-7eda4b08dbad

📥 Commits

Reviewing files that changed from the base of the PR and between 4e50e54 and 5de8181.

⛔ Files ignored due to path filters (7)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • projects/lsp-diagnostic-extend/plan.md is excluded by !projects/**
  • projects/lsp-diagnostic-extend/slices/symbol-table-diagnostics/manual-qa.md is excluded by !projects/**
  • projects/lsp-diagnostic-extend/slices/symbol-table-diagnostics/plan.md is excluded by !projects/**
  • projects/lsp-diagnostic-extend/slices/symbol-table-diagnostics/qa-run-report.md is excluded by !projects/**
  • projects/lsp-diagnostic-extend/slices/symbol-table-diagnostics/spec.md is excluded by !projects/**
  • projects/lsp-diagnostic-extend/spec.md is excluded by !projects/**
📒 Files selected for processing (14)
  • packages/1-framework/3-tooling/config-loader/src/exports/index.ts
  • packages/1-framework/3-tooling/language-server/README.md
  • packages/1-framework/3-tooling/language-server/package.json
  • packages/1-framework/3-tooling/language-server/src/config-resolution.ts
  • packages/1-framework/3-tooling/language-server/src/document-diagnostics.ts
  • packages/1-framework/3-tooling/language-server/src/pipeline.ts
  • packages/1-framework/3-tooling/language-server/src/project-artifacts.ts
  • packages/1-framework/3-tooling/language-server/src/schema-inputs.ts
  • packages/1-framework/3-tooling/language-server/src/server.ts
  • packages/1-framework/3-tooling/language-server/test/config-resolution.test.ts
  • packages/1-framework/3-tooling/language-server/test/document-diagnostics.test.ts
  • packages/1-framework/3-tooling/language-server/test/pipeline.test.ts
  • packages/1-framework/3-tooling/language-server/test/project-artifacts.test.ts
  • packages/1-framework/3-tooling/language-server/test/server.test.ts
✅ Files skipped from review due to trivial changes (2)
  • packages/1-framework/3-tooling/config-loader/src/exports/index.ts
  • packages/1-framework/3-tooling/language-server/package.json
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/1-framework/3-tooling/language-server/src/pipeline.ts
  • packages/1-framework/3-tooling/language-server/src/schema-inputs.ts
  • packages/1-framework/3-tooling/language-server/test/pipeline.test.ts
  • packages/1-framework/3-tooling/language-server/README.md
  • packages/1-framework/3-tooling/language-server/src/project-artifacts.ts
  • packages/1-framework/3-tooling/language-server/src/server.ts

Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>
@SevInf SevInf merged commit 66ba8a1 into main Jun 23, 2026
21 checks passed
@SevInf SevInf deleted the lsp-diagnostic-extend branch June 23, 2026 15:34
wmadden-electric added a commit that referenced this pull request Jun 24, 2026
Main moved 2 commits ahead (language-server PSL symbol-table
diagnostics #862, a zsh :agent-script fix #842). Neither touches the
slice's postgres target/adapter source. Clean auto-merge, no conflicts,
no src/ conflicts. Lockfile matches main; pnpm install reconciles.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
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.

1 participant