Skip to content

Conversation

artcg
Copy link

@artcg artcg commented Aug 22, 2025

add docs for block comments (added to prisma in prisma/prisma-engines#5083)

Summary by CodeRabbit

  • Documentation
    • Expanded the Prisma Schema comments section to include block comments in addition to // and ///.
    • Added syntax and guidance for using block comments to attach to the AST.
    • Updated the example to showcase a Customer model using a block comment for AST attachment.
    • Improved clarity and consistency of comment type descriptions; no behavioral or API changes.

Copy link

coderabbitai bot commented Aug 22, 2025

Walkthrough

Documentation 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

Cohort / File(s) Summary of Changes
Docs: Prisma schema comments
content/200-orm/100-prisma-schema/10-overview/index.mdx
Expanded documented comment types to include block comments; added block comment syntax for AST attachment; updated example to a Customer model using a block comment.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • nikolasburk
  • mhessdev
  • ankur-arch

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
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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 to

Placing 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 comments

Since 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 94891bc and 084c126.

📒 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)

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