use of org.eclipse.xtext.formatting2.regionaccess.ISemanticRegion in project xtext-core by eclipse.
the class SemanticRegionFinderTest method regionForRuleCallUnassignedTerminal.
@Test
public void regionForRuleCallUnassignedTerminal() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("6 (unassigned foo)");
final Mixed mixed = this.<Mixed>parseAs(_builder, Mixed.class);
final ISemanticRegionsFinder finder = this.toAccess(mixed).regionForEObject(mixed).getRegionFor();
final ISemanticRegion actual = finder.ruleCall(this._regionAccessTestLanguageGrammarAccess.getMixedAccess().getIDTerminalRuleCall_1_1_0());
final List<ISemanticRegion> actuals = finder.ruleCalls(this._regionAccessTestLanguageGrammarAccess.getMixedAccess().getIDTerminalRuleCall_1_1_0());
this.assertEquals("foo", actual, actuals);
}
use of org.eclipse.xtext.formatting2.regionaccess.ISemanticRegion in project xtext-core by eclipse.
the class SemanticRegionFinderTest method regionForFeatureCrossReference.
@Test
public void regionForFeatureCrossReference() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("6 (ref foo) action (foo) end");
final AssignedAction mixed = this.<AssignedAction>parseAs(_builder, AssignedAction.class);
final IEObjectRegion finder = this.toAccess(mixed).regionForEObject(mixed.getChild());
final ISemanticRegion actual = finder.getRegionFor().feature(RegionaccesstestlanguagePackage.Literals.MIXED__REF);
final List<ISemanticRegion> actuals = finder.getRegionFor().features(RegionaccesstestlanguagePackage.Literals.MIXED__REF);
this.assertEquals("foo", actual, actuals);
}
use of org.eclipse.xtext.formatting2.regionaccess.ISemanticRegion in project xtext-core by eclipse.
the class SemanticRegionFinderTest method regionForAssignment.
@Test
public void regionForAssignment() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("6 (foo)");
final Mixed mixed = this.<Mixed>parseAs(_builder, Mixed.class);
final ISemanticRegionsFinder finder = this.toAccess(mixed).regionForEObject(mixed).getRegionFor();
final ISemanticRegion actual = finder.assignment(this._regionAccessTestLanguageGrammarAccess.getMixedAccess().getNameAssignment_2_2_0());
final List<ISemanticRegion> actuals = finder.assignments(this._regionAccessTestLanguageGrammarAccess.getMixedAccess().getNameAssignment_2_2_0());
this.assertEquals("foo", actual, actuals);
}
use of org.eclipse.xtext.formatting2.regionaccess.ISemanticRegion in project xtext-core by eclipse.
the class SemanticRegionFinderTest method regionForKeyword.
@Test
public void regionForKeyword() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("6 (foo)");
final Mixed mixed = this.<Mixed>parseAs(_builder, Mixed.class);
final ISemanticRegionsFinder finder = this.toAccess(mixed).regionForEObject(mixed).getRegionFor();
final ISemanticRegion actual = finder.keyword(this._regionAccessTestLanguageGrammarAccess.getMixedAccess().getLeftParenthesisKeyword_0());
final List<ISemanticRegion> actuals = finder.keywords(this._regionAccessTestLanguageGrammarAccess.getMixedAccess().getLeftParenthesisKeyword_0());
this.assertEquals("(", actual, actuals);
}
use of org.eclipse.xtext.formatting2.regionaccess.ISemanticRegion in project xtext-core by eclipse.
the class SemanticRegionFinderTest method regionForRuleCallToUnassignedTerminal.
@Test
public void regionForRuleCallToUnassignedTerminal() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("6 (unassigned foo)");
final Mixed mixed = this.<Mixed>parseAs(_builder, Mixed.class);
final ISemanticRegionsFinder finder = this.toAccess(mixed).regionForEObject(mixed).getRegionFor();
final ISemanticRegion actual = finder.ruleCallTo(this._regionAccessTestLanguageGrammarAccess.getIDRule());
final List<ISemanticRegion> actuals = finder.ruleCallsTo(this._regionAccessTestLanguageGrammarAccess.getIDRule());
this.assertEquals("foo", actual, actuals);
}
Aggregations