IntelliJ IDEA supports this change as you’d expect, allowing the var keyword in the lambda. But IntelliJ IDEA 2018.2 also helps migrate the code to this updated syntax. If, for example, you were using annotations in a lambda expression, the inspection for removing the “redundant parameter types” will replace the types with var.

Along with updates for the use of var in Java 11, IntelliJ IDEA 2018.2 also has some improvements for working with var. Holding down Ctrl/⌘ and hovering over the var keyword will show the type of the variable:

Like any other type, we can click here and navigate to the declaration, or we can use Ctrl+B/⌘B to navigate to the declaration via var. We can also use Quick Documentation (Ctrl+Q/F1) or Quick Definition (Ctrl+Shift+I/⌥Space) on var to see the type.

It’s important to remember when working with this new syntax that all relevant type information needs to be on the right of the equals sign since the left side no longer declares the type. There are two inspections that have been updated to reflect this.

Firstly, IntelliJ IDEA 2018.2 understands that while sometimes an initializer is not required for a variable with an explicit type, variables created with var will use an initial value to determine the type. Therefore any “redundant initializer” warning that applies to explicit type variables is not shown for var:

Similarly, the removal of an array type is not suggested for var since it’s required:

In summary, IntelliJ IDEA 2018.2 is not only able to help when using Java 10 features, it’s ready to help us start coding with Java 11 before it’s even released!

Is the question: would we consider using Mastodon instead of Twitter? At this stage probably not, because we have a wide social network on Twitter, and for keeping as many people as possible up to date a platform with wide reach is really important.