wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
12.7k stars 1.13k forks source link

Support parsing triple slash comments in `schema.prisma` #2132

Open infomiho opened 4 days ago

infomiho commented 4 days ago

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: