-
Notifications
You must be signed in to change notification settings - Fork 108
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
Support multiple Eclipse formatter versions #52
Comments
It's pluggable [1], that's why the 4.4-formatter can be used in 4.5 too [2] . [1] https://www.eclipse.org/eclipse/news/4.5/jdt.php#JavaFormatter |
Thanks for the info @markiewb ! However, as far as I can tell, still only one formatter implementation can be active at any given time in Eclipse. So you're still going to have to touch source code in Eclipse that is "compatible" with the active formatter implementation. |
…to master * commit 'b3069a6c7217726f3b6c784c3dd8e5c0ac0c5f23': fixes regression in import statement parsing and defends against unexpected patterns
With the new Eclipse 4.7 release, there was a little change of the formatting of block comments. Which means lines which are formatted on my computer doesn't validate on the ci-system with It seems the option |
The current release of Eclipse is 4.5.1 and a number of people have expressed they are now using it. One problem though is that the formatter in 4.5 is not 100% backwards compatible with the one in 4.4 and so everyone has to keep a copy of 4.4 around to check that
mx eclipseformat
will pass integration gates that use Eclipse 4.4 for formatting checks.To support per-project opt-in adoption of Eclipse 4.5, we need mx to support multiple Eclipse formatter versions. The plan is to add support for a suite level
eclipse.formatter.version
attribute. Suites missing this attribute or whosemxversion
attribute value is lower than the mx version introducingeclipse.formatter.version
will use Eclipse 4.4 for formatting. Otherwise, theeclipse.formatter.version
value is used to find a compatible Eclipse. The search for a compatible version will use the-e/--eclipse-exe
argument of themx eclipseformat
command which will now be interpreted as a search path (like a class path). The version of an Eclipse found on the path is theversion
property in the.eclipseproduct
file. Given that the Eclipse formatter doesn’t ensure backwards compatibility, mx will require an exact match for the major and minor version numbers.Note that this issue only addresses mx based Eclipse formatting. As far as I know the Eclipse IDE only supports one formatter at a time and so sources should only be edited from within the Eclipse IDE if the associated
eclipse.formatter.version
value is compatible with the IDE version.The text was updated successfully, but these errors were encountered: