use of org.eclipse.xtext.linking.lazy.lazyLinking.Property in project xtext-core by eclipse.
the class TracingSugarTest method __generateTypeWithDebugging.
public StringConcatenationClient __generateTypeWithDebugging(final Type it) {
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("Class ");
IGeneratorNode __name = TracingSugarTest.this._myExtensions._name(it);
_builder.append(__name);
_builder.append(" {");
_builder.newLineIfNotEmpty();
{
EList<Property> _properties = it.getProperties();
for (final Property p : _properties) {
_builder.append("\t");
IGeneratorNode __generateProperty = TracingSugarTest.this._generateProperty(p);
_builder.append(__generateProperty, "\t");
_builder.newLineIfNotEmpty();
}
}
_builder.append("}");
_builder.newLine();
}
};
return _client;
}
use of org.eclipse.xtext.linking.lazy.lazyLinking.Property in project xtext-core by eclipse.
the class TracingSugarTest method __generateType.
public StringConcatenationClient __generateType(final Type it) {
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("Class ");
IGeneratorNode __name = TracingSugarTest.this._myExtensions._name(it);
_builder.append(__name);
_builder.append(" {");
_builder.newLineIfNotEmpty();
{
EList<Property> _properties = it.getProperties();
for (final Property p : _properties) {
_builder.append("\t");
IGeneratorNode __generateProperty = TracingSugarTest.this._generateProperty(p);
_builder.append(__generateProperty, "\t");
_builder.newLineIfNotEmpty();
}
}
_builder.append("}");
_builder.newLine();
}
};
return _client;
}
use of org.eclipse.xtext.linking.lazy.lazyLinking.Property in project xtext-core by eclipse.
the class TracingSugarTest method __generateTypeWithDebugging02.
public StringConcatenationClient __generateTypeWithDebugging02(final Type it) {
StringConcatenationClient _client = new StringConcatenationClient() {
@Override
protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
_builder.append("Class ");
IGeneratorNode __name = TracingSugarTest.this._myExtensions._name(it);
_builder.append(__name);
_builder.append(" {");
_builder.newLineIfNotEmpty();
{
EList<Property> _properties = it.getProperties();
for (final Property p : _properties) {
_builder.append("\t");
IGeneratorNode __generatePropertyWithDebugging = TracingSugarTest.this._generatePropertyWithDebugging(p);
_builder.append(__generatePropertyWithDebugging, "\t");
_builder.newLineIfNotEmpty();
}
}
_builder.append("}");
_builder.newLine();
}
};
return _client;
}
use of org.eclipse.xtext.linking.lazy.lazyLinking.Property in project xtext-core by eclipse.
the class BasicLazyLinkingTest method testLazyMultiRef.
@Test
public void testLazyMultiRef() throws Exception {
XtextResource resource = getResource(new StringInputStream("type A {} type B { A B a; }"));
Model m = (Model) resource.getContents().get(0);
Type t2 = m.getTypes().get(1);
Property property = t2.getProperties().get(0);
EList<Type> types = property.getType();
assertTrue(((InternalEObject) ((InternalEList<Type>) types).basicGet(0)).eIsProxy());
assertTrue(((InternalEObject) ((InternalEList<Type>) types).basicGet(0)).eIsProxy());
assertFalse(((InternalEObject) types.get(0)).eIsProxy());
assertFalse(((InternalEObject) types.get(1)).eIsProxy());
}
use of org.eclipse.xtext.linking.lazy.lazyLinking.Property in project xtext-core by eclipse.
the class BasicLazyLinkingTest method doTest.
private void doTest(XtextResource resource) {
assertTrue(resource instanceof LazyLinkingResource);
Model model = (Model) resource.getContents().get(0);
Type typeA = model.getTypes().get(0);
Type typeB = model.getTypes().get(1);
Property parentId = typeA.getParentId();
assertEquals(typeB.getProperties().get(0), parentId);
}
Aggregations