Please add @ExtensionMethod support, it is soooo usefull together with libraries like commons-lang3 and guava.
+1
very useful feature of Lombok, definitely should not be ignored.
Indeed. Very useful. This is the type of feature that is sorely missed in the Java language.
+1
Would really love to see this in the IntelliJ plugin.
Hey @mplushnikov,
Could you please pay a little bit of your attention on this feature? It's more than 2 y.o. and impact of it is huge.
Thanks!
+1
@ExtensionMethod hugely improves readability of complex manipulations, e.g. on strings - instead of local variables or very deep nesting we can have simple method call chain.
+1, this would be an awesome addition.
+1, Please add this feature to the plugin.
+1, please add this.
+1, this would be a fantastically useful feature. Tests would be so much cleaner!
@mplushnikov do you have any interest in bountysource? If so, please, set target value which you want to get for this issue :)
@mplushnikov would love to implement this feature if you'll mentor me.
:+1: I would love this feature
+1 would be awesome
:+1:
@ExtensionMethod is a huge value addition to this plugin.
@mplushnikov, do you have any plans about @ExtensionMethod?
@mplushnikov, right now 3 of 7 Lombok experimental annotations (@Delegate, @Accessors, @Wither) are supported in your plugin.
Could you, please, give us some feedback about @ExtensionMethod support? Is it planned, is it possible/hard to implement, don't you like the idea, or do you wait till it moves out of Experimental?
Unfortunately at the moment it's not possible to add support for "@ExtensionMethod". IntelliJ does not provide extension points to be able to implement this function.
@mplushnikov I think we can push it ( how it was with val ). Can you describe which extension points do you need?
I wonder how Jetbrains handles Kotlin's extension functions in its plugin. Shouldn't the implementation of @ExtensionMethod be possible somehow because the plugin API is the same?
@Sheigutn extension methods exists in a few languages like Groovy, Kotlin and others. BUT in Lombok you have to modify the way how Java language is being handled - this is a reason why it's tricky. But guys from JB are always open for proposals and we just need to determine which API we need for extension methods
@bsideup So there's no feature request on youtrack yet?
we're trying to figure out required set of APIs first
On Fri, 6 Nov 2015 at 6:19 PM Florian [email protected] wrote:
@bsideup https://github.com/bsideup So there's no feature request on
youtrack yet?—
Reply to this email directly or view it on GitHub
https://github.com/mplushnikov/lombok-intellij-plugin/issues/21#issuecomment-154456345
.
Okay, thanks for the info :)
Any progress on this issue? Any decision if it'll be done or not? If yes, any chances of having at least a rough estimate when it could be done?
I'm asking because after migrating from NetBeans to IntelliJ we've got a lot of code annotated with @ExtensionMethod, and I'm wondering whether we should refactor it (so that we don't see so much red text in the editor) or be patient...
I'm working now at better support for lombok configuration system (#53) and Builder updates (#192, #134). After it's done, I'll look more carefully on this issue. I promise!
Your bountysource program is very nice and motivating, thank you!
+1 :+1: Just discovered this feature and got all excited... :'(
Finally! :+1:
@mplushnikov Why can't you just add a fake function to the PSI or whatever its called like you do with @Getter? (forgive my ignorance of intellij's internals please)
+1 needed desperately
@mplushnikov Can't you do it however intellij does kotlin's extension methods?
Guys, we are well aware that this is a requested feature and it has not been forgotten. Please use +1 button on the original description if you simply want to express you want this too.
However this is still experimental and like Lombok documentation points out as a reason it still doesn't work in Netbeans, which also true for this plugin - it affects quite a bit of internal workings when it comes to auto-complete and refactoring, as well as delombok.
At this time, the limited time we have to put into this project is prioritized for stability & compatibility with 2016.2 EAP.
You are very welcome to contribute with a PR (instead of asking why we can't do this now) if you cannot wait until we have time to look into this.
Thanks for your work. Added $100 bounty for this feature.
I've added a $25 bounty!
@mplushnikov could you please provide any status update?
I'll look into this myself, based on how kotlin does it.
Based on my usage in kotlin, It'll be _really_ convenient, plus I want the bounty money.
This isn't working for 2016.3.
@m-manu this isn't working anywhere. We just hope that it'll be implemented
Hey @Techcable, how is it going?
@Techcable, @AlexejK, is there any reasonable chance that this will ever work, even basically? And by basically I mean: without autocomplete, refactoring support, or other "goodies". The only thing I really need it to do is not to flag extension method usages as compiler errors in the editor.
I ask because I'm on the verge of eradicating @ExtensionMethod from my codebase and giving up on them altogether rather than tolerating this red code indefinitely.
@tlinkowski @bsideup
I looked into it, and it looked like it would be _very very very_ hacky to do. I'm not very good with the IntellIJ API, and probably wouldn't be able to do it within a reasonable timeframe. As for my personal desire for @ExtensionMethod, I've mostly replaced my usage of lombok with kotlin, since it has first-class extension methods and zero-overhead lambdas/closures.
If @mplushnikov ever does manage to do this, he should be given lots of cookies and hugs, since it's very very hard.
Have there been any changes in the IntellIJ API regarding the feasibility of this enhancement?
+1
+1
+1
1+
+1
+1
+1
Commenting with +1 will not solve this issue faster.
This issue should get relabelled as the kotlin plugin seems to be able to do similar stuff.
If not, one should link to the feature request on the jetbrains issue tracker so we can add our vote there.
+1
+1
+1
P.S. It won't probably solve the issue faster but it shows interest in its resolution.
The interest is obvious enough if you will take a look at votes for this issue. It's actually already most voted issue in a history of this project. What might help here however is adding some more bounty.

I am certainly willing to up the bounty, but the thing is, even with the demand here is high, the feature is still considered experimental in Lombok itself and its future is uncertain. If we support it in the plugin today, it might break tomorrow. Its probably better to start the discussion in the Lombok project first and get the feature out of its experimental status.
I got very sad seeing this ticket was created on 15 Dec 2013 since it doesn't project very well on probability of ever getting this huge feature :<
@RStrizhak I think its still at needIntellijDeveloperSupport
+1
+1
An alternative is Manifold, which support "extension methods" and some other features.
An alternative is Manifold, which support "extension methods" and some other features.
Also Manifold only works with IntelliJ, but not with eclipse. So it's not really of much help, either.
+1
An alternative is Manifold, which support "extension methods" and some other features.
Manifold is too complicated to use.
I still have hope that someone might be able to do this. +1 (again)
+1
+1
I'd like and it will be very interesting for me to work on that issue, but the bounty looks to be too small for me
Ive increased my bounty
I've added a few grains from me. @SaltOfTheFlame what bounty size do you expect to see?
+1
Donated 50 euro. Please add this feature 🙏. Thanks for your project.
+1
+1
+1
+1
+1
+10086
Hey @mplushnikov,
I've never patched an IntelliJ plugin before, but I'm willing to help. If you give-me a small overview I'd be glad to put some effort into this issue and send you PR.
Hey @mplushnikov,
I've never patched an IntelliJ plugin before, but I'm willing to help. If you give-me a small overview I'd be glad to put some effort into this issue and send you PR.
I'll be glad to help too. I just need some tips on how to start and where to change lombok-intelliJ-plugin.
+1
+10086
@mplushnikov If it requires IntelliJ IDEA support we have to create a feature request at https://youtrack.jetbrains.net/issues/IDEA. Do we have this one?
Increased my bounty to $105.
@mplushnikov Is there any news on this one? Has the situation with the required APIs changed at all? And, if not, can you help point in the correct direction for the IDEA team?
Currently, the bounty is almost $400 USD for this issue.
Maybe can use runtime patches to support this feature?
Manifold fully supports extension methods in IntelliJ. Something else to consider, Manifold integrates extension methods much more cleanly into the Java compiler, consequently the bugs present with Lombok's extensions are not an issue with Manifold e.g., the use of generic lambdas etc. are fully supported with Manifold.
+1
+1 to Manifold, it pairs nicely with Lombok and works smooth in IDEA.
+1
+1
+1
+1 for Manifold as well, really awesome plugin. The only downside is that you must pay for the IntellIiJ plugin, or you're straight outta luck with using it. I think it's worth it though
Manifold IJ plugin is free when used with IJ Community Edition. It's also free for students and faculty, and abides by all the same deals you get with JetBrains products.
I'm a student, yet it definitely was not free for me (I can install it, sure, but it asks for a license on startup).
For the record, yes, I use IntelliJ IDEA Ultimate Edition, simply because I have a student license on JetBrains
@Frontear My bad. JetBrains plugin Marketplace is brand new and not quite complete. The student licenses do not yet extend to plugins, but they will once JB finishes that aspect of Marketplace, hopefully soon. Apologies for the confusion. If you have other questions, please take this discussion over to the Manifold side. Thanks!
Any update for this issues?
We can celebrate 6 years since this issue was opened now. 🍾 ✨ 🎆
+1 please add idea tips
+1
very useful feature
would be great to see this in the plugin
Well now that manifold requires a ridiculous and unreasonable cost, strongly adding my +1 for this again.
Not downgrading to Community Edition of IDEA just for manifold. Hopefully lombok will restore this feature for me and make it as easy to use as manifolds was.
Lombok has always had this feature, this plugin specifically does not. You can still use it and it will compile completely fine, its just that IDEA will complain.
Which makes the feature unusable. No one practical is going to tolerate code that appears to be broken.
Plus Lombok is missing project wide extension configuration (see https://github.com/rzwitserloot/lombok/issues/922 ) which is what i meant by "easy to use as manifolds"
The issue is labeled as needIntellijDeveloperSupport.
Curious what specific IntelliJ support is needed.
@ajermakovics So how manifold dose?
@mplushnikov
Yeah, you mentioned that this feature requires a lacking IntelliJ IDEA support item back in 2015. But the Manifold guys claim their implementation of the extension methods concept can work in IntelliJ, 2019. So, the remaining part of the work seems to be really doable.
Would you like to invest a little time to investigate which IntelliJ mechanism could be applied to make your plugin work? I do believe everybody here would be incredibly happy to have it supported.
Thank you.
@lyubomyr-shaydariv Manifold works different way in compare to lombok.
In Manifold you exactly defines which class should be extended by new methods and can use it then anythere on all places.
In Lombok these extension methods apply only for code that is in the annotated class, not in other classes.
The scope is the problem.
@lyubomyr-shaydariv Manifold works different way in compare to lombok.
In Manifold you exactly defines which class should be extended by new methods and can use it then anythere on all places.
In Lombok these extension methods apply only for code that is in the annotated class, not in other classes.
The scope is the problem.
Maybe scope can be inferenced from first argument of each static-methods of class, declared in @ExtentionMethod annotation?
In that code:
@ExtensionMethod(java.util.Arrays.class)
public class ExtensionMethodExample {
public String test() {
int[] intArray = {5, 3, 8, 2};
intArray.sort();
}
}
When user set cursor to intArray position and tap ".", why plugin cant just call method like:
@SneakyThrows
@Contract(pure = true)
public static <T, E> @NotNull Stream<Method> getExtensionMethodsForClass(@NotNull Class<T> targetClass,
@NotNull Class<E> extensionClass) {
return Arrays.stream(targetClass.getMethods())
.filter(method -> Modifier.isStatic(method.getModifiers()))
.filter(method -> method.getParameterTypes()[0].isAssignableFrom(extensionClass));
}
somehow like that:
getExtensionMethodsForClass(Arrays.class, int[].class)
.forEach(method -> log.info("{}", method));
and add it's result to list of self-defined object methods?
@mplushnikov thank you for the reply! To be honest, I vaguely can imagine how Lombok, lombok-intellij-plugin and Manifold work under the hood, but when you refer the scoping issue, do you mean something like:
_when a plugin adds methods to a class method list, this is done on per-project basis, not per-class_ (not a real quote)
? This probably might explain why such an approach works great for Manifold (as it declares extension methods globally), but Lombok applies the extension methods only to annotated classes. On the other hand, if your plugin would have extension methods support now, it would show extension methods for all classes, even those not annotated with @ExtensionMethod (eventually causing compilation errors outside IntelliJ)?
Is my understanding of the scoping issue correct?
? This probably might explain why such an approach works great for Manifold (as it declares extension methods globally), but Lombok applies the extension methods only to annotated classes. On the other hand, if your plugin would have extension methods support now, it would show extension methods for all classes, even those not annotated with
@ExtensionMethod(eventually causing compilation errors outside IntelliJ)?Is my understanding of the scoping issue correct?
Yes, exactly. This is the main difference.
The second difference is the location of extensions. In Manifold you have one package for it and can find it very quickly. In Lombok you would need to scan every class (and its inner classes and so on) to check for presence of annotation. But this would be possible to manage...
It seems that it's even easier to implement extension methods in lombok (library) with the manifold approach :D
And then address this issue.
@mplushnikov
It's been so many years...
I can implement this feature, but I need to transform the IntelliJ bytecode.
As you probably know, PSIClass of the array type is shared in IntelliJ, which means that it can't be done with PsiAugmentProvider, and because of lombok's design, PsiAugmentProvider doesn't fit.
I would use JNA to get an instance of java.lang.instrument.Instrumentation and register the retransformer, if there's no better way to do it.
If you are ok with this solution, I can draft a pr.
But I won't be testing any older versions, I'll just be developing based on 2020.2, and if it doesn't work on older versions, I can do compatibility fixes via logs provided by others.
Even though I'm no longer a lombok user, and I've developed richer enhancements to the Java language than lombok (global method extensions, operator overloading, default arguments, ...) .
But I still appreciate all the help I got from lombok-intellij-plugin.
Incidentally, the reason I gave up on lombok in the first place was because I ran into a bug in lombok, then I told them how to fix it, they said fine, and then nothing happened again.
@NekoCaffeine Thank you, that sounds really good! Just write me a private message, so we can discuss details of the help I can provide to you. I think we can also avoid usind retransformer, as I'm now closer to to work with IntelliJ developers and probably can apply changes to the codebase.
Yes, it's better to avoid changing bytecodes if you can.
While that's easy for me, it's not conducive to continued maintenance by those who come after.
I know enough about your plugin and how IntelliJ works.
But you should also know that there aren't many APIs that interact with PSI.
Option 1.
The entry point PsiClassImplUtil#processDeclarationsInClass, which requires transforming the bytecode.
Or make IntelliJ provide the API here.
Option 2.
Replace CLASS instances of JavaStubElementTypes by reflection, re-implement JavaClassElementType#createPsi to return a custom PsiClassImpl, and override PsiClassImpl#processDeclarations.
I'm busy working on the game engine and working on an OpenJDK bug I just encountered, so I'm sorry that I may not be able to respond in a timely manner.
I'm not sure what problems I'd run into using reflection. Transforming the bytecodes in a way that has been verified to work for my own plugins.
@NekoCaffeine If you provide some initial PR with example implementation of your idea, I'l look on it and discus with jetbrains developers how to provide new extension point for it.
That may have to wait until the weekend.
I just now took the time to test both options and sure enough option 2 failed, I tried many ways around the problem due to IntelliJ's design, but reflection is still not a viable option.


@NekoCaffeine great! Show me your code:)
There are still some minor issues, will be later when I have time to fix them.
@mplushnikov @NekoCaffeine
If your idea/workaround gets working: would it possible to highlight extension method invocations using a custom style so that real instance methods and extension methods are easily distinguishable, or extension methods would borrow static methods highlight style?
If your idea/workaround gets working: would it possible to highlight extension method invocations using a custom style so that real instance methods and extension methods are easily distinguishable, or extension methods would borrow static methods highlight style?
There doesn't seem to be such an API, but nothing is impossible to implement.
I haven't used the @ExtensionMethod, so I was hoping someone could answer my question.
1> How to handle nested classes, e.g. @ExtensionMethod(...) class A { class B {}}, does the annotation on A act on B?
2> Does it support method references?

Fantastic achievement, mate.
By looking into the provided pictures, it looks like you covered most of
the use cases.
Is there anything important missing?
On Thu, Oct 22, 2020 at 5:35 AM NekoCaffeine notifications@github.com
wrote:
[image: image]
https://user-images.githubusercontent.com/10548315/96767472-28698100-140f-11eb-81b3-a9944ba59bf4.png—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/mplushnikov/lombok-intellij-plugin/issues/21#issuecomment-713783026,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAD7NUDLCJXTWDQAYLLS3K3SL4SXDANCNFSM4AKRGT5Q
.
--
/* Miere L. Teixeira */
Is there anything important missing?
Only a few details remain to be confirmed.
The lombok developers are very responsive to questions in their Google Group: https://groups.google.com/g/project-lombok
I have never worked with ExtensionMethod due to the lacking support in editors, but if the answers are not given I can run a couple of tests using delombok to figure out how exactly it works.
I just tested it.
I need to expand the lookup and disable method references from using extended methods.
@mplushnikov Hey, I finished it a long time ago, can this pr be merged?
@NekoCaffeine really appreciate your contribution. Can you please clarify, is there any ticket or maybe PR to IntelliJ or some kind of discussion/mailing list with JetBrains to change the IDEA code to finally get rid of rocket science with code agent?
If yes, we can vote for a change at least to focus more JB attention. Thanks
Can you please clarify, is there any ticket or maybe PR to IntelliJ or some kind of discussion/mailing list with JetBrains to change the IDEA code to finally get rid of rocket science with code agent?
@seregamorph No, but the author said he was close to the developers at JetBrains and I assume he made recommendations accordingly.
And I've chosen a very stable entry point where the injected function hasn't changed in a long time and should have no need to change in the future.
Secondly, even if the injection fails, it will not have any consequences. The worst case scenario is just not supporting the annotation(@ExtensionMethod), as in the past.
I'm just wondering why I'm not getting any response, like I shouldn't be here to implement the feature.
Incidentally, the reason I gave up on lombok in the first place was because I ran into a bug in lombok, then I told them how to fix it, they said fine, and then nothing happened again.
It's exactly the same.
If I am not eligible for this bounty, then I give up.
I think there is no problem with injection at all, lombok itself uses javaagent for Eclipse.
@NekoCaffeine don't worry, just give @mplushnikov a bit of time to review this properly. He appears to be mostly on his own while maintaining this amazing plugin.
I am really happy that, after more than two years have passed since I put in my bounty, someone finally took the time to implement this feature. I am sure all other backers will agree that your bounty is well deserved.
Totally agree with @jwgmeligmeyling . I'm just looking forward on how much code I will just throw away having this feature implemented and how beautiful the code will become.
@NekoCaffeine you've done awesome job, and all people around would say the same.
Yeah, myself also looking forward for the release of this feature since very long ago 😌
@NekoCaffeine can we take a sneak peek into the plugin (i.e. do you have a plugin zip ready from download from some CI or whatnot?)?
lombok-plugin-0.33-EAP.zip
@PawelLipski
Here it is.
If you're worried about security, you can build from my branch. Just run gradlew buildPlugin, and you'll get the plugin under ./build/distributions/.
@NekoCaffeine please do a favor, what are other instructions? I mean install latest EAP (as I understood it's not compatible with current 2020.2.3). In EAP there is another problem. Since the lombok plugin is bundled by default, it cannot be upgraded manually (at least in my case each time it ended to standard version, not the installed manually), so should I delete the bundled from the IntelliJ Application plugins directory? And one more question - are any additional run parameters required or setup to switch this to enabled? Thanks in advance.
@seregamorph The version I just released doesn't require any additional work, you just need to install the plugin from disk and restart. Works fine on the 2020.3 EAP.
I'm not sure if you need to remove the built-in plugin, if it doesn't work you can try replacing it.

This feature is currently enabled by default and you can disable it as shown in the figure.
Well, are you sure it works fine with latest EAP built on Nov 05? OS: macOS


I've built 0.34-EAP from the latest commit 3f98c760270a0c3c1675825254f4b1ef8c46ae81 (@mplushnikov commit from origin/master)
But it seems that it is not working:

The extension method is not recognized and there is no lombok action (but the code can be compiled).
@seregamorph Can you upload idea.log?
Double-click shift, enter show log and select Show Log in Explorer.
@seregamorph Your situation seems strange, even if the injection fails, the switch lombok.experimental.ExtensionMethod should still be there
Can please someone else confirm that he (or she) can use the plugin (with extension methods) successfully? Which version of IDEA, OS are you using?
@seregamorph Oh, in the latest version this switch is turned off by default, try turning it on by double clicking Shift and typing lombok.experimental.ExtensionMethod. Then make any changes you want to the source code (e.g. delete a line and restore the trigger check engine).


Oh wait. I seem to see some native errors from your logs.

please note, that I'll not be available for a few next hours
@seregamorph My test platform is windows, I'm sorry I don't have macOS as a test machine. Can you assist me in following up on this issue?
It appears that the native library I need is not in your environment's resource path, but the library actually exists, so I need to write a small amount of code to support it.
Sure I can assist, but not today. Please provide the instructions
@seregamorph Can you double-click Shift and type Edit Custom VM Options to show me what's there?
I used JNA to try to load a native library that exists in the JRE, but it failed to load by default from under darwin due to the default environment of macOS.
I'm sorry to bother you too much, or I'll submit an update later and then you'll just have time to try it.
If you want, you can try adding -Djna.library.path=<your Jetbrains runtime>/Contents/Home/lib to the JVM parameters. This may fix the problem directly, but I will try to automate the fix via code to prevent the user from having to change the JVM parameters.
sorry to bother you too much
Don't worry, glad to participate.
My current vm options:
-Xmx5000m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-XX:CICompilerCount=2
-Dsun.io.useCanonPrefixCache=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Djdk.attach.allowAttachSelf=true
-Dkotlinx.coroutines.debug=off
-Djdk.module.illegalAccess.silent=true
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof
I added this line
-Djna.library.path="/Applications/IntelliJ IDEA 2020.3 EAP.app/Contents/lib"
but still no luck.
(please note, that directory that you mention does not exist).
Also tried:
-Djna.library.path="/Users/morph/Library/Application Support/JetBrains/IntelliJIdea2020.3/plugins/lombok-plugin/lib"
(contents of this directory: lombok-plugin-0.34-EAP.jar searchableOptions-0.34-EAP.jar)
Just an advice: if you have ability, you can try to run the plugin in Ubuntu, probably it'll have the similar problem.
@seregamorph
I spent the day successfully building and linking the macOS Catalina for AMD kernel. I will test it first in a virtual machine.
Thanks for the test.
Well, changed to
-Djna.library.path="/Applications/IntelliJ IDEA 2020.3 EAP.app/Contents/jbr/Contents/Home/lib"
But still not working as expected. Waiting for upgraded version for OpenJDK.

Just an advice: if you have ability, you can try to run the plugin in Ubuntu, probably it'll have the similar problem.

Just finished deploying a virtual machine and the plugin works well on Ubuntu 20.10.
lombok-plugin-0.34-EAP.zip
@seregamorph
Please try this build(2f71f72d585406312c3389e9192d9c57a8931eda) and you should not need to do anything for it to work.
@NekoCaffeine 🤩 it works!!!
That's awesome. Glory to you
@seregamorph Thanks for the test.
Since it's okay, I'm going to go take a break. It's 5:00 a.m. for me.
Nice job, mate.
Hoping that the author of this plugin merges this PR and rewards you for
the good work.
Cheers.
On Sun, Nov 8, 2020 at 7:48 AM NekoCaffeine notifications@github.com
wrote:
@seregamorph https://github.com/seregamorph Thanks for the test.
Since it's okay, I'm going to go take a break. It's 5:00 a.m. for me.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/mplushnikov/lombok-intellij-plugin/issues/21#issuecomment-723493759,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAD7NUHT45PV64ZT4NJNNTLSOWXAHANCNFSM4AKRGT5Q
.
--
/* Miere L. Teixeira */
really appreciate your contribution. Can you please clarify, is there any ticket or maybe PR to IntelliJ or some kind of discussion/mailing list with JetBrains to change the IDEA code to finally get rid of rocket science with code agent?
If yes, we can vote for a change at least to focus more JB attention. Thanks
@seregamorph @mplushnikov
https://github.com/JetBrains/intellij-community/pull/1472
Hello @NekoCaffeine , thank you for your PR for intellij-community. You can also include your code for ExtensionMethod support to it! Lombok plugin is now part of intelliJ community: https://github.com/JetBrains/intellij-community/tree/master/plugins/lombok
Guys, please note if you want to install the plugin on EAP, you should first delete bundled lombok plugin:
sudo rm -rf /Applications/IntelliJ\ IDEA\ 2020.3\ EAP.app/Contents/plugins/lombok/
Otherwise IDEA will not replace it with 0.34-EAP.
To build the plugin: on the latest master branch:
./gradlew clean buildPlugin
Hey @mplushnikov, since 2020.3 is released now, and bundled into IntelliJ (Ultimate, build 203.5981.155 in my case)... when can we expect for the ExtensionMethod support to be part of a plugin release that's bundled in IntelliJ?
And one more question - should it be version by NekoCaffeine, or other? I assume the impl should be another (so who should handle it?), because the PR by NekoCaffeine to IntelliJ was rejected and rewritten another way by @akozlova
@ExtensionMethod would be supported by the bundled lombok plugin in the first EAP of 2021.1, it would be my version
With all the respect to Anna and her revisited implementation, that's an
unexpected twist of events.
After 7 years, one had time (and guts) to implement such a valuable feature
and his PR is rejected. Hope at least a mention to his efforts is put in
the contributors note.
@akozlova can you please give any estimation when the EAP will become public for download? Thanks
@miere this PR is part of lombok plugin for older IDEA versions and it's merged. The author gets all glory which he for sure deserves! PR in IJ community is about changing IJ API and it was rejected because it's too easy to make IDEA extremely slow with it.
@schernov-xo we are going to release 2021.1 EAP in a couple of weeks.
Great news. Latest IDEA EAP has Lombok plugin (bundled by default, no manual installation or update required) that supports Lombok @ExtensionMethod!!!
https://www.jetbrains.com/idea/nextversion/
@NekoCaffeine @mplushnikov @akozlova thanks
Cool! These aren't yet fully working for me (idea-IC-211.4961.33):
final class Ext {
private Ext() { }
@SuppressWarnings("unused") // the EAP reports this as unused
public static int twice(final int i) { return i + i; }
@SuppressWarnings("unused") // the EAP reports this as unused
public static String twice(final String s) { return s + s; }
}
@ExtensionMethod(Ext.class)
final class Test {
private Test() { }
public static void main(final String... args) {
System.out.println("foo".twice()); // didn't work until the existing project purged and recovered from scratch, no issues in EAP, javac and runtime
System.out.println((2).twice()); // wow, it survives compile time and works in runtime, but the EAP highlighter reports an error "Cannot resolve method twice"
System.out.println(2.twice()); // compile time error due to Java grammar, not a big issue
}
}
CC: @akozlova
@lyubomyr-shaydariv you can raise issue https://youtrack.jetbrains.com/issues/IDEA
Great thanks for that feature - it's really cool!
But IDEA 2021.1 EAP 2 isn't auto-complete extension methods for me - is it a bug, or we just should wait for stable release?

Current implementation provides only basics highlighting: no red code should be shown (though it doesn't allow to extend primitives as reported above ^). Nothing else was tested, unfortunately
Created issues in Idea bugtracker: https://youtrack.jetbrains.com/issue/IDEA-261476 and https://youtrack.jetbrains.com/issue/IDEA-261477
Please stop using this closed issue!
Great news. Latest IDEA EAP has Lombok plugin (bundled by default, no manual installation or update required) that supports Lombok
@ExtensionMethod!!!
https://www.jetbrains.com/idea/nextversion/
@NekoCaffeine @mplushnikov @akozlova thanks
Is it publish already? I download latest EAP, but not found ExtensionMethod support
@oxsean the regular IDEA 2021.1.3 Ultimate (and I assume CE as well) has this feature, no need to download EAP.
@oxsean the regular IDEA 2021.1.3 Ultimate (and I assume CE as well) has this feature, no need to download EAP.
3ks, I test once again, the gramm support is perfect, no red error, bug autocomplete is not supported?
Yes, autocomplete is not yet supported (as mentioned before in this thread).
@mplushnikov please lock this thread. Further discussion should happen in https://youtrack.jetbrains.com/issue/IDEA-261476 and https://youtrack.jetbrains.com/issue/IDEA-261477
Most helpful comment
I'm working now at better support for lombok configuration system (#53) and Builder updates (#192, #134). After it's done, I'll look more carefully on this issue. I promise!
Your bountysource program is very nice and motivating, thank you!