Implementing Lombok extensions for different environments once (javac, Eclipse, IntelliJ IDEA, etc)

StackOverflow https://stackoverflow.com/questions/19370531

  •  30-06-2022
  •  | 
  •  

Question

Recently I discovered Project Lombok that really looks very nice. I'd even say that it really covers a lot of boilerplates at compile time while I still write a sort of workarounds that help in runtime. I can't integrate Lombok to my current project because of lack of support in IntelliJ IDEA even for the basic support w/o Lombok extensions at all. I also discovered a nice and useful Lombok extension called lombok-pg, that features really cool stuff like yield() (no more consumer-producer threads). Having a little look at lombok-pg source code I noticed that it's written both for javac and Eclipse. Both implementations seem to look very similar, but as far as I understand Lombok extension implementation activity, let's say, IntelliJ IDEA support would require another, the third, implementation of the same thing, and it doesn't sound pretty encouraging.

I'm just curious: is there any kind of a framework that provides some general interface to manage AST with implementations for different environments?

Was it helpful?

Solution

I'm just curious: is there any kind of a framework that provides some general interface to manage AST with implementations for different environments?

There ist the Lombok AST project trying to achieve exactly this. However, this all is tricky and I don't know the exact status (I only know it's not dead, last commit two weeks ago). Besides the AST manipulation, there's some compiler specific hacking to be done, especially in Eclipse, which makes it all pretty complicated.

Basically, Lombok runs in Intellij IDEA via a plugin. As the Lombok authors themselves don't use Intellij, the development has a lower priority AFAICT.

Lombok-pg is cool, but no longer maintained. Porting it into Lombok is not trivial.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top