LucasLee92
V2EX  ›  Java

关于 idea live template 的求助

  •  
  •   LucasLee92 · Dec 15, 2017 · 3901 views
    This topic created in 3249 days ago, the information mentioned may be changed or developed.

    现在无聊想写些模版方便以后自己开发偷懒,然后在写一个模版的时候卡住了,也找了官方模版方法再看,没啥帮助,希望会的兄弟帮忙给个提示什么的也好

    想实现的效果:

    • Integer i = 11;
    • i.ive ===> Integer.valueOf(光标在此).equal(i)
    5 replies  •  2017-12-25 17:01:03 +08:00
    mosliu
    mosliu
    Dec 15, 2017
    1
    把光标在此 替换成 $END$
    好多例子里面有啊。。。。
    looplj
    looplj
    Dec 15, 2017❤️1
    2
    你这个叫 Postfix Completion 不能自定义
    LucasLee92
    LucasLee92
    OP
    Dec 15, 2017
    3
    算是写出了一个基本的`Integer.valueOf($END$).equals($PARAM$)`,PARAM 对应的 complete()方法,但是这么写的话,用`i.ive`是调不出我的模版的,难道像`String s = "1"; s.sout ==> System.out.println(s);`这种模版是不能用 live template 实现的吗?
    LucasLee92
    LucasLee92
    OP
    Dec 15, 2017
    4
    YzSama
    YzSama
    Dec 25, 2017
    5
    @LucasLee92 #3
    不能。
    我之前也关注过,IDEA 只能添加 Live template 设定。
    Postfix Completion 没有办法添加设定。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1460 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 04:43 · PVG 12:43 · LAX 20:43 · JFK 23:43
    ♥ Do have faith in what you're doing.