Adding a "fake removal" as a Psi augmentation

Hi all,

I'm currently working on extending the lombok plugin to add (lombok-pg) @Builder support, and this is the first time I'm working with the IntelliJ plugin framework.

The changes are basically done, with the exception of the @Builder.Extension. This annotation allows the user to define a method on a class and annotate with @Builder.Extension - Lombok then 'lifts' this method out of the class and into the builder that is generated as part of the @Builder (class-level) annotation.

Adding the method to the builder is not a problem, however getting IntelliJ to ignore the compiler errors from whatever the user may have inside the method is proving to be a pain.

Does anyone know of a Psi class that one can use to pass the PsiAugmentProvider, that will allow us to achieve the above, e.g. Psi augmentation that essentially tells the augmentation processor to "fake remove" or somehow mask that particular method? Is there a better way to achieve this that someone could recommend?

Cheers,
SR

2 comments

I don't think we currently have any API that would allow to do that.

0

That's a shame - I guess without this, @Builder.Extension support will be very difficult or impossible.

0

Please sign in to leave a comment.