Skip to content
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

Warn about floating comments #446

Open
mhwelander opened this issue Sep 3, 2020 · 1 comment
Open

Warn about floating comments #446

mhwelander opened this issue Sep 3, 2020 · 1 comment
Labels
kind/improvement An improvement to existing feature and code. team/schema Issue for team Schema. topic: comments

Comments

@mhwelander
Copy link
Contributor

Floating comments are removed when you introspect:

model User {

// I float!

}

Would be good to have a warning in VS Code so that users aren't confused when certain comments disappear.

@carmenberndt carmenberndt added the kind/improvement An improvement to existing feature and code. label Sep 3, 2020
@matthewmueller
Copy link
Contributor

matthewmueller commented Sep 7, 2020

This feels like a bandaid to me. My preference would be to fix the AST with a specific Comment node for floating comments.

Free-floating comments are useful for documenting what the datamodel does or who's the primary owner of the datamodel.

// This datamodel powers our recommendation engine.
// 
// Owners: 
//   Mark <mark@prisma.io>
//   Alice <alice@prisma.io>
//   Nicole <nicole@prisma.io>

model User {

}

Since our Schema language is rather simple, we'd need Comment nodes in only two places: outside the blocks and inside.

@janpio janpio added team/schema Issue for team Schema. topic: comments labels Nov 19, 2021
@janpio janpio changed the title Request: Warn about floating comments Warn about floating comments Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement An improvement to existing feature and code. team/schema Issue for team Schema. topic: comments
Development

No branches or pull requests

4 participants