I'm updating my Xtext Project from 2.5.3 to 2.6.2. Now i've got a problem with my sorting quickfix. Before the update ECollections::sort() works fine.
After the update this happens:
Before quickfix:
AttributeList {
TAttribute Date
TAttribute Time
TAttribute State
LicenseNumber {
Description ""
Column LICENSE
Type Number
}
}
After quickfix (xtext 2.5.3):
AttributeList {
LicenseNumber {
Description ""
Column LICENSE
Type Number
}
TAttribut State
TAttribut Date
TAttribut Time
}
After quickfix (xtext 2.6.2):
AttributeList {
LicenseNumber {
Description ""
Column LICENSE
Type Number
}
TAttribute StateTAttribute Date
TAttribute Time
}
Grammar for the both attribut types:
Attribute:
name=ValidID '{'
('Description' beschreibung=STRING)?
'Column' column=ValidID
'Type' type=PersistenceType
'}'
;
TAttributeReference:
('TAttribute' tAttribute=[TechnicalAttribute])
|
(
'TAttribute' tAttribute=[TechnicalAttribute] '{'
('Description' description=STRING)?
('Column' column=ValidID)?
('Type' type=PersistenceType)?
'}'
)
;
The quickfix implementation
@Fix(PersistenzXtendValidator::ISSUE_CODE_WRONG_ORDER)
def fixWrongOrder(Issue issue, IssueResolutionAcceptor acceptor) {
acceptor.accept(issue, "Sort", "Sort", null,
[ element, context |
val entitaet = element as BasisEntitaet
ECollections::sort(entitaet.attribute, entitaetAttributComparator)
])
}
The Order is still correct, but the serialization failed. The attributes mixed together and the model is invalid.
Maybe someone has a hint why this could happen.
Thanks