Community
Participate
Working Groups
The semantic modification produces invalid code if the first element of a rule is created. here are the steps to reproduce (1) grammar Model: (ausgaben+=Ausgabedatum)*; Ausgabedatum: name=ID '(' 'beschreibung' beschreibung=STRING ')' '{' (datumReferenzen+=DatumReferenzOhnePflicht)+ '}' ; DatumReferenzOhnePflicht returns DatumReferenz: ( name=ID '(' 'typ' ( idTyp?='ID' | basistyp=ID | ("$" wertebereich=ID)) (('minOccurs' minOcc=INT)? & ('beschreibung' beschreibung=STRING)?) ')' ':' )? ( nil?='nil' | ( (referenz=FunktionsvariablenReferenzkette | referenz=DatenmodellReferenzkette) (mapped?='mapped')? ) ) ; FunktionsvariablenReferenzkette: "#" name=ID ; DatenmodellReferenzkette: "$" name=ID ; (2) Check public static val INVALID_NAME = 'invalidName' @Check(CheckType.NORMAL) def checkName(DatumReferenz a) { if (a.name == null) { error('there should be a name', a, null, INVALID_NAME) } } (3) Quickfix @Fix(MyDslValidator::INVALID_NAME) def capitalizeName(Issue issue, IssueResolutionAcceptor acceptor) { acceptor.accept(issue, 'Give name', 'Give the name.', 'upcase.png') [ element, context | if (element instanceof DatumReferenz) { element.name = "Name_" + System.nanoTime element.idTyp = true } ] } (4) Test modell (execute the quickfix on $b) xxxx (beschreibung "yyyy") { $a $b }
still an issue with 2.10
Still an issue in 2.11. Interestingly it works fine in the serializer