Not all project files are analyzed so nabl import Namespace x from Module m fail
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
correctly.For example use these two files that work with this spoofax language:
x.dummy
module x import y reference x
y.dummy
module y declare x
That works great, until:
- you close all files and eclipse
- you open eclipse
- open
x.dummy
- see the Unresolved reference errors at
import y
andreference x
.If you inspect the project analysis, there only seems to be an index for
Submitted by Arian on 8 December 2015 at 13:08x.dummy
, soy.dummy
seems not to be analyzed yet.
Issue Log
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.
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.
I don’t know if it’s related, but between
Spoofax: org.metaborg.spoofax.eclipse 1.5.0.20160103-174436-new-spoofax-plugin
and today’s build (org.metaborg.spoofax.eclipse 1.5.0.20160107-183026-new-spoofax-plugin
) 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.
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