Search in sources :

Example 21 with ITextRegionDiffBuilder

use of org.eclipse.xtext.formatting2.regionaccess.ITextRegionDiffBuilder in project xtext-core by eclipse.

the class RegionAccessTestHelper method modify.

public ITextRegionAccess modify(final ITextRegionAccess base, final Procedure1<? super ITextRegionDiffBuilder> modify) {
    final StringBasedTextRegionAccessDiffBuilder fac = new StringBasedTextRegionAccessDiffBuilder(base);
    modify.apply(fac);
    final StringBasedTextRegionAccessDiff modified = fac.create();
    return modified;
}
Also used : StringBasedTextRegionAccessDiffBuilder(org.eclipse.xtext.formatting2.regionaccess.internal.StringBasedTextRegionAccessDiffBuilder) StringBasedTextRegionAccessDiff(org.eclipse.xtext.formatting2.regionaccess.internal.StringBasedTextRegionAccessDiff)

Aggregations

ITextRegionAccess (org.eclipse.xtext.formatting2.regionaccess.ITextRegionAccess)17 ITextRegionDiffBuilder (org.eclipse.xtext.formatting2.regionaccess.ITextRegionDiffBuilder)17 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)16 Test (org.junit.Test)16 ISemanticRegion (org.eclipse.xtext.formatting2.regionaccess.ISemanticRegion)14 EObject (org.eclipse.emf.ecore.EObject)9 ITextRegionExtensions (org.eclipse.xtext.formatting2.regionaccess.ITextRegionExtensions)6 ValueList (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.ValueList)4 IEObjectRegion (org.eclipse.xtext.formatting2.regionaccess.IEObjectRegion)3 StringBasedTextRegionAccessDiffBuilder (org.eclipse.xtext.formatting2.regionaccess.internal.StringBasedTextRegionAccessDiffBuilder)3 List (java.util.List)2 ChangeRecorder (org.eclipse.emf.ecore.change.util.ChangeRecorder)2 Delegate (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.Delegate)2 PrefixedUnassigned (org.eclipse.xtext.formatting2.regionaccess.internal.regionaccesstestlanguage.PrefixedUnassigned)2 IUpdatableReference (org.eclipse.xtext.ide.serializer.hooks.IUpdatableReference)2 ChangeDescription (org.eclipse.emf.ecore.change.ChangeDescription)1 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)1 ITextRegionAccessDiff (org.eclipse.xtext.formatting2.regionaccess.ITextRegionAccessDiff)1 ITextReplacement (org.eclipse.xtext.formatting2.regionaccess.ITextReplacement)1 StringBasedTextRegionAccessDiff (org.eclipse.xtext.formatting2.regionaccess.internal.StringBasedTextRegionAccessDiff)1