use of org.eclipse.xtext.linking.lazy.LazyLinkingResource in project xtext-xtend by eclipse.
the class SmokeTest method testResourceUpdateSkipLastCharacters.
@Test
public void testResourceUpdateSkipLastCharacters() throws Exception {
for (String string : smokeTestModels) {
LazyLinkingResource resource = createResource("");
for (int i = 0; i < string.length(); i++) {
logProgress(i);
compareWithNewResource(resource, i, 0, String.valueOf(string.charAt(i)));
}
}
}
use of org.eclipse.xtext.linking.lazy.LazyLinkingResource in project xtext-xtend by eclipse.
the class SmokeTest method testResourceUpdateSkipCharacterInBetween.
@Test
public void testResourceUpdateSkipCharacterInBetween() throws Exception {
for (String string : smokeTestModels) {
LazyLinkingResource resource = createResource(string.substring(1));
for (int i = 0; i < string.length() - 1; i++) {
logProgress(i);
compareWithNewResource(resource, i, 1, String.valueOf(string.charAt(i)));
}
}
}
use of org.eclipse.xtext.linking.lazy.LazyLinkingResource in project xtext-xtend by eclipse.
the class LinkingErrorTest method assertNoExceptions.
protected void assertNoExceptions(EObject object) {
Resource resource = object.eResource();
if (resource instanceof LazyLinkingResource)
((LazyLinkingResource) resource).resolveLazyCrossReferences(CancelIndicator.NullImpl);
List<Diagnostic> errors = object.eResource().getErrors();
for (Diagnostic error : errors) {
if (error instanceof ExceptionDiagnostic) {
((ExceptionDiagnostic) error).getException().printStackTrace();
}
assertFalse(error.toString(), error instanceof ExceptionDiagnostic);
}
validateWithoutException((XtextResource) resource);
}
use of org.eclipse.xtext.linking.lazy.LazyLinkingResource in project xtext-core by eclipse.
the class AbstractXtextTests method doGetResource.
protected XtextResource doGetResource(InputStream in, URI uri) throws Exception {
XtextResourceSet rs = get(XtextResourceSet.class);
rs.setClasspathURIContext(getClasspathURIContext());
XtextResource resource = (XtextResource) getResourceFactory().createResource(uri);
rs.getResources().add(resource);
resource.load(in, null);
if (resource instanceof LazyLinkingResource) {
((LazyLinkingResource) resource).resolveLazyCrossReferences(CancelIndicator.NullImpl);
} else {
EcoreUtil.resolveAll(resource);
}
return resource;
}
use of org.eclipse.xtext.linking.lazy.LazyLinkingResource in project xtext-core by eclipse.
the class AbstractCleaningLinker method beforeModelLinked.
protected void beforeModelLinked(EObject model, IDiagnosticConsumer diagnosticsConsumer) {
Resource resource = model.eResource();
if (resource instanceof LazyLinkingResource) {
((LazyLinkingResource) resource).clearLazyProxyInformation();
}
ImportedNamesAdapter adapter = ImportedNamesAdapter.find(resource);
if (adapter != null)
adapter.clear();
}
Aggregations