zed-industries / extensions

Extensions for the Zed editor
740 stars 299 forks source link

Comments and doc comments capabilities #522

Open chriskrycho opened 1 year ago

chriskrycho commented 1 year ago

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:

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

mikayla-maki commented 1 year ago

i would love the block comment continuation too

l0010o0001l commented 1 year ago

Me as well! :heart:

xpader commented 11 months ago

Zed even can't keep doc block comment format when you enter the new line.

JosephTLyons commented 11 months ago

@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?

osiewicz commented 11 months ago

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.

JosephTLyons commented 11 months ago

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!

osiewicz commented 11 months ago

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.