eclipse-jdtls / eclipse-jdt-core-incubator

Eclipse Public License 2.0
8 stars 1 forks source link

[javac] module-info is not considered when parsing and compiling. #590

Open gayanper opened 3 months ago

gayanper commented 3 months ago
package app;

import com.google.gson.annotations.SerializedName;

public enum Form {
    @SerializedName("tablet") TABLET, @SerializedName("infusion") INFUSION;
}
module app {
//    requires com.google.gson;
}

The above enumeration file parse and compiled without errors with javac, but in ecj mode the parsed file shows errors due to missing module com.google.gson

gayanper commented 3 months ago

@datho7561 @mickaelistria @testforstephen any thing related to this in the planned work by you ?

datho7561 commented 3 months ago

I haven't planned on working on anything related to module-info.java files. (I'm mostly working on fixes to the bindings to get the jdt-ls tests passing). If you are interested in it, please go ahead.

mickaelistria commented 3 months ago

same for me, I currently don't plan to focus on module-info for the next weeks.

gayanper commented 2 months ago

First step towards supporting https://github.com/eclipse-jdtls/eclipse-jdt-core-incubator/pull/615.

datho7561 commented 1 month ago

I've started looking into why the AbstractImageBuilder doesn't handle projects with modules properly (as a bit of a detour while working on some semantic highlighting stuff). I expect it's because the JavacCompiler tries to use a subclass of the public API version of JavaFileObject, whereas the javac internals perform casts down to javac's own internal (inaccessible) implementation. I'll look into aligning the approach in the JavacCompiler to what we have in the JavacCompilationUnitResolver.