Open chriskrycho opened 1 year ago
i would love the block comment continuation too
Me as well! :heart:
Zed even can't keep doc block comment format when you enter the new line.
@osiewicz, are there blockers that prevent us from supporting different formats of comments for the auto comment on newline feature? I know we support //
- are we able to easily add in #
, ///
, etcetera?
It'll require a bit of work, but it shouldn't take a PhD to do that - we are mostly limited by the expressiveness of our language config format I believe.
Ahh I see, I imagined we'd be able to look up the comment style by the given languge and apply it. There I go being naive again!
Actually, I believe we already support '#' as continuation, though it is a line comment marker, not a block comment. I believe block comments are not supported right now.
Check for existing issues
Is your feature request related to a problem?
I have been a long-time user of the VS Code Auto Comment Blocks plugin, and before it similar plugins for Atom and Sublime Text. Zed doesn't have anything quite like this, and of course no plugin system to support it yet!
Key features:
Auto-generation of doc comment blocks. This uses the native comment style, e.g. for Rust it would be
/// ...
and for JS/TS it would be a block/** ... */
; and it stubs out the parameter and return types for the item in question.https://user-images.githubusercontent.com/2403023/202463130-e4ca7376-25ac-45db-8f5e-b01902855ecc.mp4
Shift ⇧ Return ⏎ continues the current comment style, whatever it is. This is especially nice when writing non-"documentation" comments, i.e. when explaining some odd code inline with
// ...
comments in JS/TS/Rust/Swift/etc.https://user-images.githubusercontent.com/2403023/202463511-eb8978f4-762c-49ab-80a8-75ac7f38b85c.mp4
Both of these are small time-savers that really add up over the course of working on any given project.
Describe the solution you'd like
Both of these features would be great, and they're not necessarily coupled. The ability to continue an existing comment style is probably the more valuable of the two from a basic text editing perspective; the other saves more time but happens much less often.
As a bonus, it would be great if hitting Return ⏎ just continues the block comment, properly indenting and including the block leader (if any), e.g.
*
when typing a block comment in JS/TS/etc.If applicable, add mockups / screenshots to help present your vision of the feature
No response