Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lombok usage of 'val' type in IntelliJ

Hi I'm using Project Lombok (version 0.11.2) in a project. I have both Intellij, and Eclipse (STS) installed, with lombok integrated with both IDEs (STS, via the lombok JAR, IntelliJ via the plugin [version 0.4, released 22/01/12]).

When I try to use the 'val' data type in IntelliJ, it fails to recognise the resulting types, however the same code works in STS.

Is this an issue with the IntelliJ plugin, or does the plugin just not support this feature?

val types were added in lombok 0.10.0, so are not a new feature.

like image 804
GKelly Avatar asked Aug 16 '12 14:08

GKelly


People also ask

What is Lombok Val?

Lombok.val allows you to. use val as the type of a local variable declaration instead of actually writing the type. When you do this, the type will be inferred from the initializer expression. The local variable will also be made final.

How do I enable annotation processing in Lombok IntelliJ?

Lombok plugin[Preference->plugins->browse repositories->search 'lombok'->install and restart idea. Preference ->search 'annotation'->enter annotation processor ->enable annotation processing.

What is Lombok plugin?

What is Lombok. Project Lombok (from now on, Lombok) is an annotation-based Java library that allows you to reduce boilerplate code. Lombok offers various annotations aimed at replacing Java code that is well known for being boilerplate, repetitive, or tedious to write.


1 Answers

At this time, according to the documentation of the Lombok IntelliJ Plugin, this is not yet supported.

Disclosure: I am one of the core Lombok developers.

like image 57
Roel Spilker Avatar answered Oct 05 '22 20:10

Roel Spilker