EclipseCodeFormatter
EclipseCodeFormatter copied to clipboard
Error message in IntelliJ : "Loaded only <X> properties from: <an_epf_file>, should be 100+"
Hello,
I have a problem with an ".epf" file exported from STS4 (based on a version of Eclipse...). I can't format my Java classes using Eclipse Code Formatter. IntelliJ shows me this message :
<my_class>.java failed to format with Eclipse Code Formatter. Use a project specific or custom formatter profile in Eclipse! Loaded only 32 properties from: <my_epf_file>, should be 100+.
And this is the same problem with a file from a "classic" Eclipse.
My IntelliJ version : IntelliJ IDEA 2020.1.2 (Ultimate Edition) Build #IU-201.7846.76, built on June 1, 2020
My Eclipse Formatter version : 20.2.201.6668.0-Eclipse_2020-06-JavaOnly
My EPF file (in ".TXT") : preferences_STS.epf.txt
In a previous configuration (IntelliJ and/or Eclipse Code Formatter...), it was working....
Could you help me, please ?
Thanx.
Yes, I added a validation, because it is possible to produce config files without an actual configuration, like yours.
Actually, I need to make it even more precise and a better error message, because yours have no /instance/org.eclipse.jdt.core/org.eclipse.jdt.core.formatter
at all (so that the formatter works with some default configuration - if you want that, then just choose one of the build-in options).
It should look like this: https://github.com/OpenGamma/Strata/blob/master/eclipse/install/Strata-Eclipse-Preferences.epf How it is produced I do not know.
OK, I understand.
But, in Eclipse/STS4, I chose "export All" in the wizard. So, how can I do better (and not write the file manually, if possible ^^ :-D ) ?
And I thought your plugin was looking in an Eclipse default configuration if something was missing.
However, thank you very much for your work :-).
try this https://liuzy163.wordpress.com/2014/09/19/eclispe-workspace-mechanic-for-java-code-formatting-in-team-environment/
OK. Thank you.
But, I will find another way. This "plugin" seems to be no longer available... (I mean, the plugin you proposed to me ^^''...)
I seem to be getting the same error while trying to format the code after importing a formatter XML.
"failed to format with Eclipse Code Formatter. Use a project specific or custom formatter profile in Eclipse! Loaded only 86 properties from: \path-to-file\codeformatting.xml, should be 100+."
I noticed that my XML has 86 properties (
Update -> Added the zipped XML. codeformatting.zip
post the xml
I noticed something I didn't earlier. My previously uploaded formatter XML was generated by checkstyle (converting checkstyle rules into eclipse formatter xml), I had imported the same into the eclipse (code style -> formatter). But when I export the same again, it now has 100+ properties, which then doesn't fail validateConfig
method.