use of org.eclipse.xtext.linking.lazy.lazyLinking.UnresolvedProxyProperty in project xtext-core by eclipse.
the class BasicLazyLinkingTest method testBug281775_02.
@Test
public void testBug281775_02() throws Exception {
String model = "type A {\n" + " unresolved A B a;\n" + "}\n" + "type B {\n" + " unresolved B A b;\n" + "}";
XtextResource resource = getResource(new StringInputStream(model));
Model m = (Model) resource.getContents().get(0);
Type t1 = m.getTypes().get(0);
assertEquals("A", t1.getName());
Type t2 = m.getTypes().get(1);
assertEquals("B", t2.getName());
UnresolvedProxyProperty propA = t1.getUnresolvedProxyProperty().get(0);
assertEquals(2, propA.getType().size());
assertEquals(t1, propA.getType().get(0));
assertEquals(t2, propA.getType().get(1));
UnresolvedProxyProperty propB = t2.getUnresolvedProxyProperty().get(0);
assertEquals(2, propB.getType().size());
assertEquals(t2, propB.getType().get(0));
assertEquals(t1, propB.getType().get(1));
}
use of org.eclipse.xtext.linking.lazy.lazyLinking.UnresolvedProxyProperty in project xtext-core by eclipse.
the class LazyLinkingTestLanguageSemanticSequencer method sequence.
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == LazyLinkingPackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case LazyLinkingPackage.MODEL:
sequence_Model(context, (Model) semanticObject);
return;
case LazyLinkingPackage.PROPERTY:
sequence_Property(context, (Property) semanticObject);
return;
case LazyLinkingPackage.TYPE:
sequence_Type(context, (Type) semanticObject);
return;
case LazyLinkingPackage.UNRESOLVED_PROXY_PROPERTY:
sequence_UnresolvedProxyProperty(context, (UnresolvedProxyProperty) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Aggregations