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

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

Open
javacode123 opened this issue Nov 27, 2023 · 5 comments
Open

Comments

@javacode123
Copy link

javacode123 commented Nov 27, 2023

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
Copy link
Author

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

@SevInf
Copy link
Contributor

SevInf commented Nov 27, 2023

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.

@javacode123
Copy link
Author

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

@janpio
Copy link
Contributor

janpio commented Nov 27, 2023

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?

@javacode123
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants