ceylon-ide-eclipse
ceylon-ide-eclipse copied to clipboard
Model loader gets confused when it finds empty Java files
In ceylon-ide-common, we have a file named SingleSourceUnitPackage.java
, which is entirely commented because it was rewritten in Ceylon in a file named SingleSourceUnitPackage.ceylon
, located in the same package.
When I try to import this class in a Ceylon unit that belongs to another project that depends on ceylon-ide-common, I get a strange error in Eclipse:
could not determine type of function or value reference: 'singleSourceUnitPackage'
imported declaration not found: 'SingleSourceUnitPackage'
type does not exist: 'SingleSourceUnitPackage'
If I remove the empty Java file, the error disappears. The CLI seems to ignore the Java file as expected.
ceylon-ide-eclipse does not suffer from this issue because classes that use SingleSourceUnitPackage
are all written in Java.
I can also work around the problem by renaming the Java file. It looks like the JDT model loader assumes that Foo.java
will always contain a class Foo
, whereas the file can be empty.