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

feat: comment complete for tidy style doc comment #1029

Merged
merged 11 commits into from
Dec 21, 2024

Conversation

Eric-Song-Nop
Copy link
Collaborator

@Eric-Song-Nop Eric-Song-Nop commented Dec 19, 2024

for #1015

@Eric-Song-Nop Eric-Song-Nop changed the title feat: generate tidy style doc comment feat: comment complete for tidy style doc comment Dec 19, 2024
@Eric-Song-Nop Eric-Song-Nop marked this pull request as ready for review December 19, 2024 11:44
@Eric-Song-Nop
Copy link
Collaborator Author

For now this pull request just complete a doc string as comment complete, it is not considering the known type of the parameters, while from my perspective works better when this feature is implemented as a docstring updater or a code action.

Copy link
Owner

@Myriad-Dreamin Myriad-Dreamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it looks pretty nice. We are starting to be on the rails~

crates/tinymist-query/src/upstream/complete.rs Outdated Show resolved Hide resolved
crates/tinymist-query/src/upstream/complete.rs Outdated Show resolved Hide resolved
@Myriad-Dreamin
Copy link
Owner

I start to experience it and have found several points. We might start to complete a "Document function" only if the comment is a "doc comment" and only contains nothing.

  • if user only enters two slashes, they might not purpose to make a documentation.
  • we seems to be triggering the completion in the comment everywhere, e.g. when I put a dot in the comment.
    image
  • we can also generates documentation for variables.

@Eric-Song-Nop
Copy link
Collaborator Author

Eric-Song-Nop commented Dec 20, 2024

if user only enters two slashes, they might not purpose to make a documentation.
we seems to be triggering the completion in the comment everywhere, e.g. when I put a dot in the comment.

I have stricted the condition. Tbh, why doc comment does not utilize block comment but line comment, it's really annoying.

we can also generates documentation for variables.

If I know correctly, doc a variable has no specific format right? Do we really need to complete anything for it?

@Eric-Song-Nop Eric-Song-Nop self-assigned this Dec 20, 2024
@Myriad-Dreamin
Copy link
Owner

Tbh, why doc comment does not utilize block comment but line comment, it's really annoying.

Caused that we borrow the format from rust.

If I know correctly, doc a variable has no specific format right? Do we really need to complete anything for it?

You might know it wrongly. You can document any let binding items.

/// A swap operation. 
///
/// - a (B): It was b.
/// - b (A): It was a.
/// -> (B, A)
#let (a, b) = (b, a);


/// A simpler example. 
///
/// -> content
#let embedded-file = context metadata(query(<output>));

@Myriad-Dreamin Myriad-Dreamin merged commit d9cec6e into Myriad-Dreamin:main Dec 21, 2024
14 checks passed
@Eric-Song-Nop
Copy link
Collaborator Author

Eric-Song-Nop commented Dec 21, 2024

You might know it wrongly. You can document any let binding items.

Oh I didn't know this

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

Successfully merging this pull request may close these issues.

2 participants