Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » import resolution during editing
import resolution during editing [message #986976] Thu, 22 November 2012 16:22 Go to next message
Defert Philippe is currently offline Defert PhilippeFriend
Messages: 62
Registered: July 2009

I developed an object-oriented language that uses the "import":
"package ;
class clsa {
var foo = "hello"
} "

"package ;
import ;
class clsb {
clsa sample;
var foo2 = + "world"
} "

I managed to handle imports during the Build. Resolutions are made ​​
public class myOolDslScopeProvider extends
AbstractDeclarativeScopeProvider {
and i have delagateScoper:
public class SkoolDslScopeProviderDelegate extends
ImportedNamespaceAwareLocalScopeProvider {
protected List<ImportNormalizer>
internalGetImportedNamespaceResolvers(EObject context, boolean ignoreCase) {
List<ImportNormalizer> importedNamespaceResolvers =
super.internalGetImportedNamespaceResolvers(context, ignoreCase);
if (context instanceof PackageElt) {
System.err.println("internalGetImportedNamespaceResolvers -- " +
context + " " + importedNamespaceResolvers);
PackageElt pkg = EcoreUtil2.getContainerOfType(context,
if (pkg != null) {
String ownNamespace = pkg.getName() + ".*";
System.err.println("internalGetImportedNamespaceResolvers -- " +

} else {
System.out.println("package not found");
return importedNamespaceResolvers;

But I have a trouble when I'm in the editor.
When I change the contents of CLSB, as a space for example,providerscope
is unable to resolve CLSA, he can not find the declaration of import
and package
So mark it "CLSA sample," with an error.

if I save the file, the build Solve correctly, but the marker remains on
the file.

To remove the marker I have to do a clean and rebuild the workspace

Have you ever seen this problem?


Re: import resolution during editing [message #987000 is a reply to message #986976] Thu, 22 November 2012 18:15 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 7871
Registered: July 2009
Senior Member

can you share your grammar. it may be not optimal for error recovery

Previous Topic:Add Environment Library
Next Topic:Xtext generated Java Main
Goto Forum:

Current Time: Sun Nov 29 21:34:34 GMT 2015

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

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