IntelliJ IDEA no code completion for Java 10 'var'?

前端 未结 2 1583
一生所求
一生所求 2021-01-05 10:32

Recently I installed the new version (2018.1) of IntelliJ IDEA, which added support for Java 10.

But when I trying to use the var (for local variable

相关标签:
2条回答
  • 2021-01-05 11:22

    As @Vic pointed out, this appears to be a bug. Until it gets fixed, you can create a custom live template as a workaround.

    Create a live template triggered by the var abbreviation, then enter var as the template text. Make it available in the Java statement context.

    0 讨论(0)
  • 2021-01-05 11:27

    Issue has been fixed in upcoming IntelliJ IDEA 2018.2 release:

    https://www.jetbrains.com/idea/nextversion/ (currently EAP version)

    0 讨论(0)
提交回复
热议问题