-
Notifications
You must be signed in to change notification settings - Fork 845
add docs for block comments (added to prisma in prisma/prisma-engines#5083) #7081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughDocumentation update in Prisma schema overview: adds block comments as a third comment type alongside // and ///, documents block comment syntax for AST attachment, and updates the example to show a Customer model using a block comment. No code or API changes. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
content/200-orm/100-prisma-schema/10-overview/index.mdx (3)
160-166
: Clarify block-comment AST semantics; small grammar/consistency tweaks
- Make the attachment behavior explicit for block comments (same “next-node” rule as
///
).- Minor grammar fix (“supported or included”), and introduce the PSL acronym for consistency.
Proposed diff:
-There are three types of comments that are supported in Prisma Schema Language: +There are three types of comments supported in the Prisma Schema Language (PSL): - `// comment`: This comment is for the reader's clarity and is not present in the abstract syntax tree (AST) of the schema. -`/// comment`: These comments will show up in the abstract syntax tree (AST) of the schema as descriptions to AST nodes. Tools can then use these comments to provide additional information. All comments are attached to the next available node - [free-floating comments](https://github.com/prisma/prisma/issues/3544) are not supported and are not included in the AST. -`/* block comment */`: These comments will show up in the abstract syntax tree, similarly to `///` comments. +`/// comment`: These comments will show up in the abstract syntax tree (AST) of the schema as descriptions to AST nodes. Tools can then use these comments to provide additional information. All comments are attached to the next available node — [free-floating comments](https://github.com/prisma/prisma/issues/3544) are not supported or included in the AST. +`/* block comment */`: These comments show up in the AST as descriptions to AST nodes. Attachment rules are identical to `///`: they are attached to the next available node; free‑floating block comments are not included in the AST.Follow-up:
- Please confirm that block comments follow the exact same “attach to next node” behavior in all positions (top-level, inside blocks), and that there are no exceptions the docs should call out. If there are edge cases (e.g., nested comments not allowed), we can add a short note.
182-186
: Make the example unambiguous about what the block comment attaches toPlacing the block comment as the first item inside an otherwise empty model can be read ambiguously. To avoid confusion, put the block comment immediately above the
model
declaration so it clearly attaches to the model node. Optionally add a field so the example compiles as a valid model.Proposed diff:
-/// This comment will get attached to the -/// Customer node. -model Customer { - /** - * ...and so will this comment - */ -} +/** This block comment will get attached to the `Customer` node in the AST */ +model Customer { + id Int @id +}If you want to show both styles together, consider two separate minimal examples (one with
///
above the model, one with/** ... */
above the model) to keep attachment behavior crystal clear. Please verify with the parser that the suggested positioning matches actual AST attachment.
160-166
: Add “since” version note for block commentsSince this is a newly introduced language feature, a short availability note reduces confusion for users on older Prisma versions.
Suggested addition right after the list of comment types:
+> Note +> Block comments (`/* ... */`) are supported starting in Prisma ORM vX.Y.Z. Upgrade Prisma to use this feature.Replace vX.Y.Z with the actual version once confirmed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
content/200-orm/100-prisma-schema/10-overview/index.mdx
(2 hunks)
🧰 Additional context used
🪛 LanguageTool
content/200-orm/100-prisma-schema/10-overview/index.mdx
[grammar] ~163-~163: There might be a mistake here.
Context: ...pported and are not included in the AST. - /* block comment */
: These comments will show up in the abs...
(QB_NEW_EN)
add docs for block comments (added to prisma in prisma/prisma-engines#5083)
Summary by CodeRabbit