Schema comments not showing in generated client
See original GitHub issueBug description
From the schema comments documentation I understand that triple-slash comments result in the comments existing in the final client types/objects, hence will show up in intellisense in VSCode. Somehow, for me, that does not work at all. Am I missing something that this might currently not be supported in my environment?
How to reproduce
Expected behavior
Comments show up in prop description in vscode.
Prisma information
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
/// This comment should show up as field description (intellisense)
model Image {
id String @id @default(cuid())
/// This should show up as well
name String
path String
hash String @unique
}
Environment & setup
- OS: Mac OS
- Database: PostgreSQL 9
- Node.js version: 12.16.2
- Prisma version: 2.5.1
Any ideas?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to show XML comments of class properties in Swagger ...
I've created the XML comments file but comments are not seen in the Model section of Swagger UI. asp.net-web-api2 · asp.net-core-mvc · swagger...
Read more >Documentation and Comments - GraphQL - Dgraph
Schema Documentation Processed by Generated API ... These comments are not passed via the generated API and are not visible in the API...
Read more >How to write comments in a GraphQL Schema to enhance ...
How to write comments in a GraphQL Schema to enhance auto-generated documentation · Additional comments added show up in the Type Details section....
Read more >Using $ref - Swagger
In that case, you can create a snippet for such elements in order to use ... For example, suppose you have the following...
Read more >CREATE SCHEMA - Snowflake Documentation
Specifies a comment for the schema. Default: No value. Access Control Requirements¶. A role used to execute this SQL command must have the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, those comments does show up in the internal AST but we don’t render a JSDoc comment for them. I think we can do that.
Today, we produce comments for the model types and its properties. However, even though we have commented types, intellisense won’t show up on top-level types unless referenced directly (ie. type-level only, import that type).
So I think, one solution to showing top-level model/type comments would be to do this on
prisma.<model>
.Right now, we have generated examples there, but I don’t see why we could not prepend user comments.