Giter Club home page Giter Club logo

Comments (7)

liyaodong avatar liyaodong commented on July 17, 2024 6

FYI tide-jsdoc-templatecan insert now

from typescript.el.

dgutov avatar dgutov commented on July 17, 2024 1

In js2-mode, it's wasn't a particular decision to write js2-line-break instead of using c-indent-new-comment-line.

Before I got to it, js2-line-break was a command js2-enter-key bound to RET. So using a custom 'comment-line-break-function function provides some continuity.

So c-indent-new-comment-line might be a good choice of you, except it's tying you to CC Mode a bit, and will probably require you to set a few related variables.

from typescript.el.

josteink avatar josteink commented on July 17, 2024

From the docs:

C-M-j runs the command indent-new-comment-line (found in global-map), which is an alias for ‘comment-indent-new-line’ in ‘newcomment.el’.

Running this command anywhere in typescript-mode gives mixed results:


var x;
|<- newline here

//
//|<- newline here

/*
/*|<- newline here

/**
/*|<- newline here

If we're going to override this command with a custom command for typescript-mode, we should properly address all these comment-styles.

from typescript.el.

ananthakumaran avatar ananthakumaran commented on July 17, 2024

I wonder whether we should rebind M-j to c-indent-new-comment-line by default. It seems to work better than indent-new-comment-line from my minimal testing.

from typescript.el.

josteink avatar josteink commented on July 17, 2024

That's a good idea, and leaves us reinventing fewer wheels than we need to.

Have you experienced any cases where that does anything which is explicitly wrong?

from typescript.el.

raxod502 avatar raxod502 commented on July 17, 2024

It might also be relevant to ask @dgutov if there is a reason that js2-mode doesn't do this, and instead implements its own js2-line-break function.

from typescript.el.

ananthakumaran avatar ananthakumaran commented on July 17, 2024

Have you experienced any cases where that does anything which is explicitly wrong?

It's not as good as js2-mode, but better than what we have. I never encountered any case so far where indent-new-comment-line is better

from typescript.el.

Related Issues (20)

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.