Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change constructor template in IntelliJ

I'm using lombok heavily and got @RequiredArgsConstructor in my class templates.

Now lets say I type new Foo("bar"), and class Foo does not exist but I want IntelliJ to create it as well as the constructor.

At the moment IntelliJ creates the following body for the class:

public Foo(String bar){ }

But I would like to have this instead:

@NonNull @Getter String bar;

Any way to accomplish this?

like image 960
Seppo420 Avatar asked Nov 06 '25 12:11

Seppo420


1 Answers

At the moment there is no way to customize constructor templates in IntelliJ IDEA.

It may be worth filing a request to Lombok plug-in developer so that he can provide some workaround.

If it turns out that the issue cannot be addressed on the plug-in side, feel free to submit a request in YouTrack.

like image 164
CrazyCoder Avatar answered Nov 09 '25 04:11

CrazyCoder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!