language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Warn about floating comments

Open mhwelander opened this issue 5 years ago • 1 comments

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.

mhwelander avatar Sep 03 '20 13:09 mhwelander

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 <[email protected]>
//   Alice <[email protected]>
//   Nicole <[email protected]>

model User {

}

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

matthewmueller avatar Sep 07 '20 08:09 matthewmueller