Andrea Sindico
Andrea Sindico

Reputation: 7440

XText: Global Scope and importedURI

I am having some troubles in configuring scoping in my DSL

In my mwe2 I have set

 // scoping and exporting API
 fragment = scoping.ImportURIScopingFragment {}
 fragment = exporting.SimpleNamesFragment {}

with this configuration the content assist provides all the possible references (those contained in the same file and those contained in different files within the project) despite the import. This means that without any import I still see in the content assist references to elements of the right type but defined into different files. when I chose one of these references the compiler depicts it as an error "coulnd't resolve reference to.. " although the referenced element is defined into an imported file. Note that the import seembs to be correcty resolved as I don't see any "Imported resource could not be found." error that I would expect as I have also configured

fragment = validation.JavaValidatorFragment {
                composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
                composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
            } 

What am I doing wrong?

Upvotes: 0

Views: 872

Answers (1)

Andrea Sindico
Andrea Sindico

Reputation: 7440

As explaind in this post http://www.eclipse.org/forums/index.php/t/486553/

you also have to comment...

// provides the necessary bindings for java types integration
// fragment = types.TypesGeneratorFragment {}

// generates the required bindings only if the grammar inherits from Xbase
// fragment = xbase.XbaseGeneratorFragment {}

then it works fine

Upvotes: 1

Related Questions