Skip to content

v8.0.0-rc.8-dev.16

@StevenMcClankerton StevenMcClankerton tagged this 08 Sep 09:13
Fixes false language-server diagnostics for valid PSL schemas that
`contract emit` accepts, including the schema generated by `prisma orm
init`.

## Changes

- Replace constructor-identity checks in all 11 attribute combinators
with existing kind-based AST casts.
- Add an integration regression comparing CLI emission with the LSP
diagnostic pipeline across the internal-parser/public-interpreter
boundary. Cover the init schema, literal defaults and mapped names, and
genuine invalid-function diagnostics.

## Why

The LSP parses with its own parser and passes the artifacts to the
project's interpreter. Those packages can contain separate AST class
copies, so `instanceof` rejects valid function calls, arrays, and
literals. Emission works because its parser and interpreter share class
identities. Kind-based casts preserve validation without requiring
constructor identity.

**Scope:** Attribute argument validation and regression coverage only;
no schema syntax or emission behavior changes. Existing projects need
updated ORM packages because the checks run in the project-loaded
interpreter.

## Verification

- Confirmed the regression fails before the fix with the seven reported
init-schema diagnostics.
- Three integration cases pass after the fix.
- PSL parser, language-server, SQL PSL, and Mongo PSL suites pass: 1,556
tests.
- Parser, language-server, and integration-project typechecks pass.
- Parser lint, new-test lint, and changed-file diagnostics pass.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved parsing consistency for boolean, numeric, string, JSON, list,
record, identifier, field, entity, and function-reference values.
* Preserved existing validation rules and diagnostics while improving
syntax handling.

* **Tests**
* Added integration coverage confirming that language-server diagnostics
match contract validation results across valid and invalid schemas.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Steven McClankerton <tatarintsev@prisma.io>
Co-authored-by: Steven McClankerton <tatarintsev@prisma.io>
Assets 2
Loading