Code Monkey home page Code Monkey logo

Comments (5)

alexey-kozlenkov avatar alexey-kozlenkov commented on May 22, 2024 1

Hey 👋
Any chances to move newly added snippets for arrow function for TS to a new name?
Perhaps af for TS -> aft (arrow function typed) / taf (typed arrow function)

Bringing this up cause i.e. af changed and now requires to press tab 4 times to get to function body instead of previous 2 times. (Personally I'm a lot muscle-memorized it and 3.1.0 update now brings frustration. )
Thanks!

from vscode-hyper-javascript-snippets.

t7yang avatar t7yang commented on May 22, 2024

I was indecisive to this issue, very happy someone give me feedback.

What if:
af : ($1)$2 => $0 (should/shouldn't add $2 for return type? click 2 times to get to function body)
afg : $1($2)$3 => $0 (new, g stand for generic/generator maybe arrow generator function in future)

from vscode-hyper-javascript-snippets.

alexey-kozlenkov avatar alexey-kozlenkov commented on May 22, 2024

I'd go with an option

  • leave af as it was: plain "js" function (seems to me pretty often use-case for some callbacks where TS infers return type)
  • add afg with $1($2)$3 => $0 for any other use case when user need to provide generics/return type

In general, my point : having backward compatibility would be awesome. I personally use af like 50 times a day and very get used to it format.
Having new snippet for typed one is good, however, in my opinion, shouldn't kill existing behavior. 🙏

from vscode-hyper-javascript-snippets.

t7yang avatar t7yang commented on May 22, 2024

Finally, I provide four new snippets ar, ara (with return type), ag, aga (with generic and return type).

from vscode-hyper-javascript-snippets.

alexey-kozlenkov avatar alexey-kozlenkov commented on May 22, 2024

Thanks for the efforts @t7yang!

from vscode-hyper-javascript-snippets.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.