Hacker News new | ask | show | jobs
by asukachikaru 501 days ago
I use only one snippet both before and after integrating copilot (provided by my employer) into my workflow, which is for creating a empty arrow function (in JavaScript / TypeScript.)

Copilot have not been able to generate arrow functions when I intend to, in my experience. I found it pretty incompetent, and unable to provide relevant assistance if there is any bit of abstraction. YMMV.

I reckon my need for this specific snippet could be replaced with a more competent agent. I recently subscribed to cursor and so far it seems promising.

3 comments

This puzzles me. `arg => expression`, `(args, …) => expression`, `arg => { block }`, `(args, …) => { block }`… they’re not hard or long to type, and there are the different forms of argument list and body, so that I imagine you’d want more than one snippet (at least for expression versus block, considering some style guides say “always parenthesise argument lists”), and the entire thing seems not at all worth it.
> which is for creating a empty arrow function

you have a snippet for four characters? `()=>`?

There's also brackets. More importantly, it is easier for me to type `afn` than `shift + 9`.
Interesting, I have not found this to be the case. Can probably get yourself a foot pedal and crank out those arrow fn snippets.
Same for me, I use "ar <tab>" in Intellij all the time.