zed icon indicating copy to clipboard operation
zed copied to clipboard

Expand `log` to `console.log()`

Open JosephTLyons opened this issue 1 year ago • 6 comments

Check for existing issues

  • [X] Completed

Is your feature request related to a problem?

In JetBrains’ tooling, in JS and TS, you can type log then hit tab and it will expand to console.log(). It’s a small thing, but it’s so nice. We should see if we can add this feature. Maybe this calls for some generic system that allows you to define, per language, maps that link some input text into an expanded form.

Describe the solution you'd like

https://user-images.githubusercontent.com/19867440/205404075-3ebdb865-7651-41e8-81cb-019fee3f87d6.mov

If applicable, add mockups / screenshots to help present your vision of the feature

No response

JosephTLyons avatar Dec 02 '22 11:12 JosephTLyons

It is called "Live Templates" in IntellJ. Really useful thing, need it in zed

ushankax avatar Dec 14 '22 05:12 ushankax

We need generalized version of this. So each user can add their own shortcut to boost productivity 🚀

Pringlers avatar Dec 14 '22 08:12 Pringlers

yep, live templates and postfixes are amazing features from the intellij platform, and if zed would implement something similar that would be an amazing productivity boost

I'm attaching a couple screenshots from both live templates, which can be invoked directly, or if there is a $SELECTION$ block they can also be used to wrap code in refactors; and postfix expressions, which allows configuring custom templates to replace the code when invoking .expression

@ushankax @Pringlers it would be nice to 👍🏻 this issue if you think this is a nice feature 🙂

capture-20221214093358 capture-20221214093304

aexvir avatar Dec 14 '22 08:12 aexvir

It might be possible to achieve this already with an LSP snippet, similar to https://github.com/zed-industries/feedback/issues/566#issuecomment-1273791513

rkusa avatar Dec 16 '22 18:12 rkusa

Bumping as this is one little thing that makes me miss VSCode. It's just muscle memory but such a time saver!

mediabeastnz avatar Apr 23 '24 21:04 mediabeastnz

bumping this.

plato-creative avatar Apr 23 '24 21:04 plato-creative