prisma-engines icon indicating copy to clipboard operation
prisma-engines copied to clipboard

psl: Can not get documentation from model when these is a empty line.

Open javacode123 opened this issue 1 year ago • 5 comments

when there is an empty line between the comment and model, can not get documentation image i wan to know why do not process empty line. THX https://github.com/prisma/prisma-engines/blob/main/psl/schema-ast/src/parser/parse_schema.rs#L54

javacode123 avatar Nov 27 '23 08:11 javacode123

when there is an empty line between the comment and model, can not get documentation image i wan to know why do not process empty line. THX https://github.com/prisma/prisma-engines/blob/main/psl/schema-ast/src/parser/parse_schema.rs#L54 maybe this is better? image

javacode123 avatar Nov 27 '23 09:11 javacode123

I think this is consistent with pretty much any doc-comment systems out there? Putting empty line after a comment would detach it from the thing it used to document in JavaDoc, JSDoc/TSDoc, rust doc comments, as far as I am aware.

SevInf avatar Nov 27 '23 10:11 SevInf

I think this is consistent with pretty much any doc-comment systems out there? Putting empty line after a comment would detach it from the thing it used to document in JavaDoc, JSDoc/TSDoc, rust doc comments, as far as I am aware.

it seems that rust doc comments will work when there is space line

/// commnet A

pub struct A {}

截屏2023-11-27 19 47 52

javacode123 avatar Nov 27 '23 11:11 javacode123

That sounds dangerous. If I just want to take a note in the middle of the file, when using a /// it would then get attached magically to the next block/model instead of just floating, wouldn't it? What is the benefit of this behavior?

janpio avatar Nov 27 '23 19:11 janpio

That sounds dangerous. If I just want to take a note in the middle of the file, when using a /// it would then get attached magically to the next block/model instead of just floating, wouldn't it? What is the benefit of this behavior?

Okay, you convinced me.

javacode123 avatar Nov 28 '23 01:11 javacode123