git00ll
V2EX  ›  问与答

idea 如何自定义点号 后面的提示

  •  
  •   git00ll · Jul 21, 2021 · 1251 views
    This topic created in 1778 days ago, the information mentioned may be changed or developed.

    idea 如何自定义点号 后面的提示。

    如:存在变量 list

    List<String> list
    

    在 list 后面使用

    list.for
    

    idea 会自动弹出 增强型 for 循坏普通 for 循环倒序 for 循环三个选项

    但在 groovy 文件中的 list 后面采用同样的方法,只会弹出闭包风格的循环,现在想要在 groovy 文件里也弹出增强型 for 循环提示。

    如何自定义点号后面的提示模板呢

    4 replies    2021-07-21 15:51:17 +08:00
    AoEiuV020
        1
    AoEiuV020  
       Jul 21, 2021
    Insert Live Template
    我没试过,不过官方文档应该有说,
    https://www.jetbrains.com/help/idea/generate-custom-code-constructs-using-live-templates.html
    git00ll
        2
    git00ll  
    OP
       Jul 21, 2021
    @AoEiuV020 你好,尝试过这个。这个是指在直接写 ‘for’,自动根据模板补全,不是在一个变量后面输入 ‘点号’ 弹出提示再补全
    wolfie
        3
    wolfie  
       Jul 21, 2021
    PostFix Completion
    AoEiuV020
        4
    AoEiuV020  
       Jul 21, 2021
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5529 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 07:57 · PVG 15:57 · LAX 00:57 · JFK 03:57
    ♥ Do have faith in what you're doing.