use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.PrefixedDelegate in project xtext-core by eclipse.
the class PrefixedUnassignedImpl method basicSetDelegate.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDelegate(PrefixedDelegate newDelegate, NotificationChain msgs) {
PrefixedDelegate oldDelegate = delegate;
delegate = newDelegate;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RegionaccesstestlanguagePackage.PREFIXED_UNASSIGNED__DELEGATE, oldDelegate, newDelegate);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.PrefixedDelegate in project xtext-core by eclipse.
the class RegionAccessBuilderTest method testUnassignedPrefixedDelegate.
@Test
public void testUnassignedPrefixedDelegate() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("4 prefix foo");
_builder.newLine();
String _trim = _builder.toString().trim();
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append(" ");
_builder_1.append("0 0 H");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("B PrefixedUnassigned Root");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("0 1 S \"4\" PrefixedUnassigned:\'4\'");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("1 1 H \" \" Whitespace:TerminalRule\'WS\'");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("B Delegate\'foo\' PrefixedUnassigned:delegate=PrefixedDelegate path:PrefixedUnassigned/delegate");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("2 6 S \"prefix\" PrefixedDelegate:\'prefix\'");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("8 1 H \" \" Whitespace:TerminalRule\'WS\'");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("9 3 S \"foo\" Delegate:name=ID");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("E Delegate\'foo\' PrefixedUnassigned:delegate=PrefixedDelegate path:PrefixedUnassigned/delegate");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("E PrefixedUnassigned Root");
_builder_1.newLine();
_builder_1.append("12 0 H");
_builder_1.newLine();
this.operator_tripleEquals(_trim, _builder_1);
}
use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.PrefixedDelegate in project xtext-core by eclipse.
the class RegionAccessDiffTest method testDeleteOne.
@Test
public void testDeleteOne() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("4/*1*/prefix/*2*/foo");
_builder.newLine();
final ITextRegionAccess access = this._regionAccessTestHelper.toTextRegionAccess(_builder);
final Procedure1<ITextRegionDiffBuilder> _function = (ITextRegionDiffBuilder it) -> {
@Extension final ITextRegionExtensions ext = access.getExtensions();
EObject _semanticElement = access.regionForRootEObject().getSemanticElement();
final PrefixedUnassigned rootObj = ((PrefixedUnassigned) _semanticElement);
final ISemanticRegion prefix = ext.regionFor(rootObj.getDelegate()).keyword("prefix");
it.remove(prefix);
};
ITextRegionAccess _modify = this._regionAccessTestHelper.modify(access, _function);
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append(" ");
_builder_1.append("0 0 H");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("B PrefixedUnassigned Root");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("0 1 S \"4\" PrefixedUnassigned:\'4\'");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("1 1 H \"/*1*/\" Comment:TerminalRule\'ML_COMMENT\' Association:CONTAINER");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("10 \"/*2*/\" Comment:TerminalRule\'ML_COMMENT\' Association:CONTAINER");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("B Delegate\'foo\' PrefixedUnassigned:delegate=PrefixedDelegate path:PrefixedUnassigned/delegate");
_builder_1.newLine();
_builder_1.append("11 3 S \"foo\" Delegate:name=ID");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("E Delegate\'foo\' PrefixedUnassigned:delegate=PrefixedDelegate path:PrefixedUnassigned/delegate");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("E PrefixedUnassigned Root");
_builder_1.newLine();
_builder_1.append("14 0 H");
_builder_1.newLine();
_builder_1.append("------------ diff 1 ------------");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("1 5 H \"/*1*/\" Comment:TerminalRule\'ML_COMMENT\' Association:CONTAINER");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("6 6 S \"prefix\" PrefixedDelegate:\'prefix\'");
_builder_1.newLine();
_builder_1.append("12 5 H \"/*2*/\" Comment:TerminalRule\'ML_COMMENT\' Association:CONTAINER");
_builder_1.newLine();
this._regionAccessTestHelper.operator_tripleEquals(_modify, _builder_1);
}
use of org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.PrefixedDelegate in project xtext-core by eclipse.
the class RegionAccessDiffTest method testDeleteTwo.
@Test
public void testDeleteTwo() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("4/*1*/prefix/*2*/foo/*3*/");
_builder.newLine();
final ITextRegionAccess access = this._regionAccessTestHelper.toTextRegionAccess(_builder);
final Procedure1<ITextRegionDiffBuilder> _function = (ITextRegionDiffBuilder it) -> {
@Extension final ITextRegionExtensions ext = access.getExtensions();
EObject _semanticElement = access.regionForRootEObject().getSemanticElement();
final PrefixedUnassigned rootObj = ((PrefixedUnassigned) _semanticElement);
final ISemanticRegion prefix = ext.regionFor(rootObj.getDelegate()).keyword("prefix");
final ISemanticRegion foo = ext.regionFor(rootObj.getDelegate()).feature(RegionaccesstestlanguagePackage.Literals.DELEGATE__NAME);
it.remove(prefix.getPreviousHiddenRegion(), foo.getNextHiddenRegion());
};
ITextRegionAccess _modify = this._regionAccessTestHelper.modify(access, _function);
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append(" ");
_builder_1.append("0 0 H");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("B PrefixedUnassigned Root");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("0 1 S \"4\" PrefixedUnassigned:\'4\'");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("E PrefixedUnassigned Root");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("1 1 H \"/*1*/\" Comment:TerminalRule\'ML_COMMENT\' Association:CONTAINER");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("10 \"/*3*/\" Comment:TerminalRule\'ML_COMMENT\' Association:CONTAINER");
_builder_1.newLine();
_builder_1.append("------------ diff 1 ------------");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("1 5 H \"/*1*/\" Comment:TerminalRule\'ML_COMMENT\' Association:CONTAINER");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("6 6 S \"prefix\" PrefixedDelegate:\'prefix\'");
_builder_1.newLine();
_builder_1.append("12 5 H \"/*2*/\" Comment:TerminalRule\'ML_COMMENT\' Association:CONTAINER");
_builder_1.newLine();
_builder_1.append("17 3 S \"foo\" Delegate:name=ID");
_builder_1.newLine();
_builder_1.append("20 5 H \"/*3*/\" Comment:TerminalRule\'ML_COMMENT\' Association:CONTAINER");
_builder_1.newLine();
this._regionAccessTestHelper.operator_tripleEquals(_modify, _builder_1);
}
Aggregations