EclipseCodeFormatter icon indicating copy to clipboard operation
EclipseCodeFormatter copied to clipboard

Error message in IntelliJ : "Loaded only <X> properties from: <an_epf_file>, should be 100+"

Open Great-Fred opened this issue 4 years ago • 7 comments

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.

Great-Fred avatar Jul 06 '20 13:07 Great-Fred

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.

krasa avatar Jul 06 '20 14:07 krasa

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 :-).

Great-Fred avatar Jul 06 '20 14:07 Great-Fred

try this https://liuzy163.wordpress.com/2014/09/19/eclispe-workspace-mechanic-for-java-code-formatting-in-team-environment/

krasa avatar Jul 06 '20 14:07 krasa

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 ^^''...)

Great-Fred avatar Jul 06 '20 15:07 Great-Fred

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 ( elements). Why is that a problem though?

Update -> Added the zipped XML. codeformatting.zip

notjustacoder avatar Mar 05 '21 15:03 notjustacoder

post the xml

krasa avatar Mar 05 '21 15:03 krasa

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.

notjustacoder avatar Mar 05 '21 16:03 notjustacoder