Skip to content

Support parsing triple slash comments in schema.prisma #2132

Open
@infomiho

Description

@infomiho

While reading some blogs about Prisma I found out that there is a special type of comment in Prisma:

/// that looks like this

As explained in the Prisma docs:

/// 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 are not supported and are not included in the AST.

These comment need to survive parsing and should be in our AST so we can also output them in the final Prisma schema.

The triple slash comments can be:

  • above a block
  • one a standalone line in the block body
  • trailing after some block line

Metadata

Metadata

Assignees

Labels

prismashouldfixWe should do/fix this at some point

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions