laibin
V2EX  ›  Java

请教一个 Idea 自动声明的快捷键

  •  
  •   laibin · Mar 24, 2016 · 4015 views
    This topic created in 3881 days ago, the information mentioned may be changed or developed.
    比如现有 state.compareAndSet(expect, update); 语句。
    什么快捷键能变成:

    boolean result = state.compareAndSet(expect, update);
    11 replies  •  2016-04-24 15:37:19 +08:00
    Ouyangan
    Ouyangan
    Mar 24, 2016
    1
    这...我竟无言已对,懒癌晚期
    funCoder
    funCoder
    Mar 24, 2016❤️2
    2
    ctrl+alt+v
    laibin
    laibin
    OP
    Mar 24, 2016
    3
    @Ouyangan
    有时候不知道方法的返回值是什么。
    laibin
    laibin
    OP
    Mar 24, 2016
    4
    @funCoder 谢谢。
    Ouyangan
    Ouyangan
    Mar 24, 2016
    5
    重构的时候用于抽取变量 ctrl+alt+v @laibin 已验证,实测有效.非常感谢 @funCoder
    m939594960
    m939594960
    Mar 24, 2016
    6
    @funCoder 还有这么神奇的功能 学到了~~~
    funCoder
    funCoder
    Mar 24, 2016❤️2
    7
    Eclipse 也有个类似的 CTRL + 2 + L
    laibin
    laibin
    OP
    Mar 24, 2016
    8
    @m939594960
    extract variable 叫做。。。
    写了这么久 Java 竟然才想起来要找这个,惭愧惭愧
    chenwen
    chenwen
    Mar 25, 2016 via iPhone❤️1
    9
    用 idea 的 postfix completion 功能,输入 compareAndSet(expect, update).var ,按 tab 键就行了
    laibin
    laibin
    OP
    Mar 25, 2016
    10
    @chenwen
    这个更赞,哈哈哈。
    extract variable 应该是重构用更方便。
    cxzl25
    cxzl25
    Apr 24, 2016
    11
    state.compareAndSet(expect, update).var + [TAB]
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1630 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 13:36 · PVG 21:36 · LAX 05:36 · JFK 08:36
    ♥ Do have faith in what you're doing.