Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Linking issue while programmatic validation
Linking issue while programmatic validation [message #1745271] Fri, 07 October 2016 07:43 Go to next message
Neeraj Bhusare is currently offline Neeraj BhusareFriend
Messages: 177
Registered: July 2009
Location: Canada
Senior Member

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 :
Best regards, Neeraj
Re: Linking issue while programmatic validation [message #1745285 is a reply to message #1745271] Fri, 07 October 2016 09:59 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14498
Registered: July 2009
Senior Member
Can you reproduce this with the domain model example as well?

Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :
Previous Topic:Unit Testing the Language
Next Topic:problem with using import quickfix
Goto Forum:

Current Time: Fri Jun 09 12:46:38 GMT 2023

Powered by FUDForum. Page generated in 0.02047 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top