代码之家  ›  专栏  ›  技术社区  ›  Erik

如何在iTelijIdAd/Android工作室中添加自定义的KTLIN后缀完成?

  •  1
  • Erik  · 技术社区  · 6 年前

    看来我不能为Kotlin添加自定义的后缀完成,既不使用因特利思(2018.3),也不在Android Studio(3.2.1)中。如果我转到preferences editor general postfix completion并单击add按钮,则没有kotlin选项(请参见下面的屏幕截图)。是否可以添加新的后缀补全?

    我想加一个 .with 修复后完成,以便 x.with 会扩展到

    with(x) {
        // The caret should go here
    }
    

    旁注:我觉得很遗憾没有为 with 开箱即用。

    IntelliJ IDEA(2018.3)和Android Studio(3.2.1)截图:

    IntelliJ IDEA postfix completion settings Android Studio postfix completion settings

    1 回复  |  直到 6 年前
        1
  •  2
  •   Erik Pragt    6 年前

    我查过了,在android工作室和intellij都不可能。可能定义语言还不支持kotlin。

    但是,您可以尝试以下插件: https://plugins.jetbrains.com/plugin/9862-custom-postfix-templates .

    它看起来维护得很好,并且支持scala、kotlin、groovy等。我自己也没有尝试过,但是根据文档,它似乎是您要找的。