Skip to content

Commit

Permalink
Add java.jdt.ls.javac.enabled setting.
Browse files Browse the repository at this point in the history
- Report setting through 'telemetry/event' notification
- Use a JDK 23 for building
- Bump ECJ to 3.39.0.v20240820-0604

Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
  • Loading branch information
rgrunber committed Oct 16, 2024
1 parent c0ed19c commit 916a72a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 23
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '23'
distribution: 'temurin'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public void onBuildFinished(long buildFinishedTime) {
properties.add("buildFileNames", buildFileNamesList);
}
properties.addProperty("javaProjectCount", javaProjectCount);
properties.addProperty("javac.enabled", Boolean.toString(prefs.getPreferences().isJavacEnabled()));
if (sourceLevelMin != 0) {
properties.addProperty("compiler.source.min", Float.toString(sourceLevelMin));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,11 +516,13 @@ public class Preferences {

public static final String JAVA_JDT_LS_PROTOBUF_SUPPORT_ENABLED = "java.jdt.ls.protobufSupport.enabled";
public static final String JAVA_JDT_LS_ANDROID_SUPPORT_ENABLED = "java.jdt.ls.androidSupport.enabled";
public static final String JAVA_JDT_LS_JAVAC_ENABLED = "java.jdt.ls.javac.enabled";

public static final String JAVA_COMPILE_NULLANALYSIS_NONNULL = "java.compile.nullAnalysis.nonnull";
public static final String JAVA_COMPILE_NULLANALYSIS_NULLABLE = "java.compile.nullAnalysis.nullable";
public static final String JAVA_COMPILE_NULLANALYSIS_NONNULLBYDEFAULT = "java.compile.nullAnalysis.nonnullbydefault";
public static final String JAVA_COMPILE_NULLANALYSIS_MODE = "java.compile.nullAnalysis.mode";
public static final String JAVA_COMPLETION_ENGINE = "java.completion.engine";

public static final String LIFECYCLE_MAPPING_METADATA_SOURCE_NAME = "lifecycle-mapping-metadata.xml";

Expand Down Expand Up @@ -702,6 +704,7 @@ public class Preferences {
private ProjectEncodingMode projectEncoding;
private boolean avoidVolatileChanges;
private boolean protobufSupportEnabled;
private boolean javacEnabled;
private boolean androidSupportEnabled;
private List<String> nonnullTypes;
private List<String> nullableTypes;
Expand Down Expand Up @@ -958,6 +961,7 @@ public Preferences() {
inlayHintsParameterMode = InlayHintsParameterMode.LITERALS;
projectEncoding = ProjectEncodingMode.IGNORE;
avoidVolatileChanges = true;
javacEnabled = false;
nonnullTypes = new ArrayList<>();
nullableTypes = new ArrayList<>();
nonnullbydefaultTypes = new ArrayList<>();
Expand Down Expand Up @@ -1335,6 +1339,8 @@ public static Preferences createFrom(Map<String, Object> configuration) {
prefs.setAvoidVolatileChanges(avoidVolatileChanges);
boolean protobufSupported = getBoolean(configuration, JAVA_JDT_LS_PROTOBUF_SUPPORT_ENABLED, false);
prefs.setProtobufSupportEnabled(protobufSupported);
boolean javacEnabled = getBoolean(configuration, JAVA_JDT_LS_JAVAC_ENABLED, false);
prefs.setJavacEnabled(javacEnabled);
boolean androidSupported = getBoolean(configuration, JAVA_JDT_LS_ANDROID_SUPPORT_ENABLED, false);
prefs.setAndroidSupportEnabled(androidSupported);
List<String> nonnullTypes = getList(configuration, JAVA_COMPILE_NULLANALYSIS_NONNULL, Collections.emptyList());
Expand Down Expand Up @@ -1379,10 +1385,10 @@ public static Preferences createFrom(Map<String, Object> configuration) {
}
}
prefs.setFilesAssociations(new ArrayList<>(associations));

String searchScope = getString(configuration, JAVA_SEARCH_SCOPE, null);
prefs.setSearchScope(SearchScope.fromString(searchScope, SearchScope.all));

return prefs;
}

Expand Down Expand Up @@ -2381,6 +2387,14 @@ public void setAndroidSupportEnabled(boolean androidSupportEnabled) {
this.androidSupportEnabled = androidSupportEnabled;
}

public boolean isJavacEnabled() {
return this.javacEnabled;
}

public void setJavacEnabled(boolean javacEnabled) {
this.javacEnabled = javacEnabled;
}

public List<String> getNonnullTypes() {
return this.nonnullTypes;
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<cbi.jarsigner.skip>true</cbi.jarsigner.skip>
<generateSourceRef>true</generateSourceRef>
<cbi-jdt-repo.url>https://repo.eclipse.org/content/repositories/eclipse-staging/</cbi-jdt-repo.url>
<cbi-ecj-version>3.38.0.v20240524-2033</cbi-ecj-version>
<cbi-ecj-version>3.39.0.v20240820-0604</cbi-ecj-version>
</properties>
<modules>
<module>org.eclipse.jdt.ls.target</module>
Expand Down

0 comments on commit 916a72a

Please sign in to comment.