Open eclipse-ocl-bot opened 2 months ago
By Ed Willink on Jan 02, 2015 09:37
The Xtext formatting rules have limited capability. With the grammar as it stands the only change that has any effect is no-space-around the name-assignment. A finer-grained config for the different name-assignment-sources is ignored.
Not even changing the grammar to
(name=InfixOperatorName | name=NavigationOperatorName)
so that there two different name assignments to configure differently has any effect. It seems that the non-space setting overrides the other.
Clearly an Xtext bug.
There are other limitations too related to comments.
Need to dig deep into the Xtext serializer so that we can add overrides that work.
For now we must choose:
spaces around navigation\ no spaces around infixes
no-spaces seems the better choice since navigation is more prolific.
By Ed Willink on Jan 02, 2015 09:50
(In reply to Ed Willink from comment #1)
no-spaces seems the better choice since navigation is more prolific.
Pushed to master for M5:
commit 9a853892d36664784a14def18665f67d63e84788
(Bug stays open since infix operators no longer have surrounding spaces.)
By Ed Willink on Jan 02, 2015 10:56
QVTd master tests just failed. No spaces around an "and" infix operator gives illegal source text.
By Ed Willink on Jan 02, 2015 15:26
The serilaization goes through the ValueConverterService so we can add a BinaryOperatorName that wraps spaces around Infix but nort Navigation operators allowing the outer ExpCS formatting to strip spaces.
Pushed to master for M5.
commit 1a36000db8f818bb9afedc09240b4ee7bb12b1c2
| --- | --- | | Bugzilla Link | 456524 | | Status | NEW | | Importance | P3 normal | | Reported | Jan 02, 2015 09:10 EDT | | Modified | Jan 02, 2015 15:26 EDT | | Reporter | Ed Willink |
Description
No EssentialOCLFormatter rule is provided for binary operators (including navigation operators) so all are surrounded by default whitespace.