-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java formatting #20
Comments
That‘s very cool. Would you like to contribute to this feature? |
I actually got it working in a fork - the functionality itself was simple, the big issue is the CDT dependency. Not sure if you can have optional dependencies in Eclipse plugins? I ended up just removing all CDT references to make it work. Either way, having CDT installed should obviously not be a requirement for formatting Java code. |
Nice and very useful tool! Would it be possible to merge @Gama11's proposed commit 6edf38b be and eventually release this? The commit seems to be fairly small... I'd use it even with the CDT dependency as we are also using C/C++ in addition to Java. Many thanks in advance and thanks again for your good work! |
Hi Gama11, Steps to reproduce:
I didn't understand yet, why the SaveAction fails in combination with the formatter. Also I saw that you didn't add the ClangFormatFormatter as a JavaFormatter via the extension point |
I got a version which works fine for Java in my fork: |
I have tried both CppStyle and ClangFormat4J and the functionality seemed identical in the latest Eclipse (Version: 2023-03 (4.27.0)) configured to format on save. |
Are there any plans to support Java formatting? According to https://clang.llvm.org/docs/ClangFormat.html, this is supported by clang-format.
Presumably this would mostly be UI work, and clang-format could be called the same way?
The text was updated successfully, but these errors were encountered: