Linking issue while programmatic validation [message #1745271] |
Fri, 07 October 2016 07:43  |
Neeraj Bhusare Messages: 177 Registered: July 2009 Location: Canada |
Senior Member |
|
|
Hi,
I have a dsl that allows me to define functions. I have customized the LogicalContainerAwareReentrantTypeResolver#addExtensionsToMemberSession() so that I can cross-reference the function directly, as compared to using new MyClass().fooFunc(). The Xbase compiler is customized to generate appropriate code.
When open in editor, the functions are linked properly and I can navigate to them. However, when I try to validate the resourceset programmatically, the resource contains an error - The method foo() is not defined. Here, foo() is a method that is cross-referenced in function Bar. My guess is that the linker is failing to link the functions.
I am using the following code to validate the resourceset. I have tried resolving the resourceset (EcoreUtil.resolveAll(resourceSet)) however it didn't help.
final XtextResourceSet resourceSet = (XtextResourceSet) resourceSetProvider.get(project);
for (Resource resource : resourceSet.getResources()) {
final XtextResource xtextResource = (XtextResource) resource;
xtextResource.getResourceServiceProvider().getResourceValidator().validate(xtextResource, CheckMode.ALL, CancelIndicator.NullImpl)
xtextResource.getErrors() //print the errors
}
How do I deal with this problem ? Any specific code that I should debug to get some clarity ?
Tx in advance.
PS : I am sorry, I cannot share the code that I have customized in the Xbase compiler and LogicalContainerAwareReentrantTypeResolver.
Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj
|
|
|
|
Powered by
FUDForum. Page generated in 0.02047 seconds