IntelliJ autocomplete escape

后端 未结 4 1277
北恋
北恋 2021-02-20 07:37

I\'m trying out IntelliJ and have one minor annoyance that I can\'t figure out if there is a possible solution for in IntelliJ. In Eclipse and even TextMate (as well as many ot

4条回答
  •  遇见更好的自我
    2021-02-20 08:24

    i tried cmd-shift-enter (on mac) and the result seems more useful to me (in javascript code). i'm using a pipe ('|') to visualize the cursor here:

    before:

    var x = func1(func2(|))
    

    after pressing cmd-shift-enter:

    var x = func1(func2());|
    

    so it even adds the semicolon at the end of the line (but you still have to press enter again to jump to the next line).

    EDIT

    just found this shortcut is even more useful:

    before:

    if(a == b|)
    

    after pressing cmd-shift-enter:

    if(a == b) {
        |
    }
    

    works both in php and javascript

提交回复
热议问题