I made an example project that shows the error: https://github.com/arian/spoofax-import-test

This projects shows that importing things from other modules are not working

For example use these two files that work with this spoofax language:


module x
import y
reference x


module y
declare x

That works great, until:

  1. you close all files and eclipse
  2. you open eclipse
  3. open x.dummy
  4. see the Unresolved reference errors at import y and reference x.

If you inspect the project analysis, there only seems to be an index for x.dummy, so y.dummy seems not to be analyzed yet.

Submitted by Arian on 8 December 2015 at 13:08

On 6 January 2016 at 16:21 Gabriël Konat tagged major

On 7 January 2016 at 17:53 Gabriël Konat commented:

Thanks for the simple repro case, that helped a lot. I figured out the problem. In the old Spoofax, all languages in a project share the same index and task engine, but in the new Spoofax, they are all in a different context. However, I did not change the name of the index and task engine file to include the language id, so they get overwritten when there are multiple languages in the same project (read: always). Name and type information is then lost after a restart.

Working on a fix now.

On 7 January 2016 at 18:32 Gabriël Konat commented:

This is fixed now. There is still an issue with having example files of a language in the same project. Those files are not analyzed automatically because there is no dependency to that language in the project (that wouldn’t make sense). You should put example files in a separate examples project, and add a dependency to the language in that project so that Spoofax will analyze the programs.

There’s also a different issue with reference resolution not working after a restart: https://yellowgrass.org/issue/SpoofaxWithCore/26.

On 7 January 2016 at 18:32 Gabriël Konat closed this issue.

On 8 January 2016 at 00:06 Arian commented:

I don’t know if it’s related, but between Spoofax: org.metaborg.spoofax.eclipse and today’s build (org.metaborg.spoofax.eclipse a bin folder is created inside the (separate) project (with spoofax meta nature) with example files. This includes copies of the original files. Besides that this is a bit weird, it might also cause duplicate declarations or wrong references.

On 8 January 2016 at 11:01 Gabriël Konat commented:

That is odd, I’m not sure if that is related. Can you open a separate issue for that and tell me how I can reproduce that? I’m fine with checking out and building MetaC to reproduce it.

Log in to post comments