Community
Participate
Working Groups
Build Identifier: Build id: I20110613-1736 If AutoBuild (Project -> Build Automatically) is disabled and the project has been cleaned, then the linking of objects defined in other resources fails. It seems that the IBuilderState is empty, while it is used by DirtyStateAwareResourceDescriptions, which is used by the DefaultGlobalScopeProvider. Reproducible: Always Steps to Reproduce: 1. have a language that uses a global scope provider extending DefaultGlobalScopeProvider to resolve external references 2. write 2 source files: one (f1) defining a reference-able entity, and another file (f2) that uses the first one (reference the entity defined in f1). Save the files, close f1, keep f2 opened. The reference is actually linked (and can be navigated, e.g., with F3). 3. disable AutoBuild (Project > Build automatically) in the Eclipse that uses the plug-in being developed. 4. clean the project (Project > Clean...) 5. the reference in the source files are not linked anymore (warning displayed and cannot be navigated anymore).
When the checkbox "Start a build immediately" in the dialog to clean projects is checked the described problem is not reproduceable. Could you please verify.
Yes indeed, "Start a build immediately" ensures that the project is built and linking works. Although, by modifying the sources, the descriptions saved during build may become outdated and linking may not work as intended.
This is true for Java too. So this is the expected behavior. The default global scope is contructed through a builder. If the automatic build is disabled the scope gest outdated.
There must be something I do wrong. In Java, when I disable AutoBuild and clean the project, global references are NOT marked as errors (but incorrect references are, which means that some linking is done). It is also possible to Open Declaration (F3), or find References, which is not possible for languages implemented with XText.
That may be true for Java. However, Xtext's default linking is based on the index which is populated by a builder. We will not reimplement all the infrastructure as the JDT guys did.