Hi,
It took me quite some time to debug this so I'm posting here in case it will help anyone :
Issue:
I had a problem where my macro inserting text would be totally messed up after closing and reopening Eclipse.
Instead of inserting my text, it would only insert some blanks lines.
Upon exporting my macro before and afer reopening Eclipse, it appeared that the .xml file was formatted differently.
Fix
tl;dr: Stick to JRE 8 (I'm using jre1.8.0_231)
Unless it's been overridden by something else, you can configure which VM Eclipse should use in the eclipse.ini file. Add this option (adapted to your system of course) right before the -vmargs option :
-vm C:/Program Files/Java/jre1.8.0_231/bin/server/jvm.dll
Upon investigating the code and different Eclipse configurations, it appeared that the "TransformerFactory" used to store the macros as a "IPreferenceStore" changed behaviour starting from JRE 9.
I didn't push the analysis to check JRE 9 release note but it seems that the transformer is now also doing some prettifying which mess up the macro that include newlines in their commands and possibly others.
Considering the plugin code, I suspect this line to be the culprit but can't be sure of it, I didn't regenerate the plugin :
trans.setOutputProperty(OutputKeys.INDENT, "yes");
Cheers.
Anonymous