use of org.eclipse.xtext.linking.bug287988Test.Model in project xtext-core by eclipse.
the class Bug407280Test method testFindActualSemanticObjectFor.
@Test
public void testFindActualSemanticObjectFor() throws Exception {
String modelAsString = "actions attribute ref attr1 attr2;";
int idx = modelAsString.indexOf("attr1");
Model model = (Model) getModelAndExpect(modelAsString, 1);
/* linking issue */
INode root = NodeModelUtils.getNode(model).getRootNode();
ILeafNode leafNodeAtOffset = NodeModelUtils.findLeafNodeAtOffset(root, idx);
assertEquals("attr1", leafNodeAtOffset.getText());
EObject semanticObject = NodeModelUtils.findActualSemanticObjectFor(leafNodeAtOffset);
assertSame(model.getAttributes().get(0), semanticObject);
}
Aggregations