Skip to content

Commit 28670c5

Browse files
robstrykerclaude
authored andcommitted
Remove the experimental javac mode
The org.eclipse.jdt.core.javac bundle this depended on required always running with the latest JDK to support the latest Java release, and has stopped being maintained; the bundle is being dropped from the jdt.ls target platform and shipped product. Removes java.jdt.ls.javac.enabled entirely, along with the system properties/--add-opens flags javaServerStarter.ts only sent when it was enabled (these referenced classes -- JavacCompilationUnitResolver, JavacCompilerFactory, DOMJavaSearchDelegate -- that no longer exist in the shipped product), the JDK-25 requirement bump in requirements.ts, and the config-change watcher/normalization code in settings.ts and utils.ts. Also removes java.completion.engine: its only non-default value, dom, only had any effect through the removed javac code path, so with that gone the setting offered no real choice -- selecting ecj or dom already produced identical behavior. Dropped the corresponding telemetry field and documentation in README.md/USAGE_DATA.md. Fixes #4546 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent ea2852d commit 28670c5

7 files changed

Lines changed: 2 additions & 101 deletions

File tree

‎README.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,6 @@ The following settings are supported:
279279
- Find Reference
280280
- Call Hierarchy
281281
- Workspace Symbols
282-
* `java.jdt.ls.javac.enabled`: [Experimental] Specify whether to enable Javac-based compilation in the language server. Requires running this extension with Java 24. Defaults to `off`.
283-
* `java.completion.engine`: [Experimental] Select code completion engine. Defaults to `ecj`.
284282
* `java.references.includeDeclarations`: Include declarations when finding references. Defaults to `true`
285283
* `java.jdt.ls.appcds.enabled`: [Experimental] Enable Java AppCDS (Application Class Data Sharing) for improvements to extension activation. When set to `auto`, AppCDS will be enabled in Visual Studio Code - Insiders, and for pre-release versions.
286284
* `java.hover.javadoc.enabled`: Enable/disable displaying Javadoc on hover. Defaults to `true`.

‎USAGE_DATA.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ vscode-java has opt-in telemetry collection, provided by [vscode-redhat-telemetr
1919
* Errors relating to running the language server, such as the message & stacktrace
2020
* Whether there is a mismatch between the project's requested source level, and the JDK used for the project (e.g. true)
2121
* Information about the following settings. In the case of settings that store a well defined value (e.g. path, url or string), we simply collect whether the setting has been set.
22-
* `java.settings.url`, `java.format.settings.url`, `java.quickfix.showAt`, `java.symbols.includeSourceMethodDeclarations`, `java.completion.collapseCompletionItems`, `java.completion.guessMethodArguments`, `java.completion.postfix.enabled`, `java.cleanup.actionsOnSave`, `java.sharedIndexes.enabled`, `java.inlayHints.parameterNames.enabled`, `java.inlayHints.parameterNames.suppressWhenSameNameNumbered`, `java.inlayHints.variableTypes.enabled`, `java.inlayHints.parameterTypes.enabled`, `java.server.launchMode`, `java.autobuild.enabled`, `java.jdt.ls.javac.enabled`
22+
* `java.settings.url`, `java.format.settings.url`, `java.quickfix.showAt`, `java.symbols.includeSourceMethodDeclarations`, `java.completion.collapseCompletionItems`, `java.completion.guessMethodArguments`, `java.completion.postfix.enabled`, `java.cleanup.actionsOnSave`, `java.sharedIndexes.enabled`, `java.inlayHints.parameterNames.enabled`, `java.inlayHints.parameterNames.suppressWhenSameNameNumbered`, `java.inlayHints.variableTypes.enabled`, `java.inlayHints.parameterTypes.enabled`, `java.server.launchMode`, `java.autobuild.enabled`
2323
* The extension name and the choice made when a recommendation to install a third-party extension is proposed
2424
* The name of Java commands being manually executed, and any resulting errors
25-
* The number of results (e.g. 20), whether an error occurred (e.g. false), engine type (e.g. 'ecj', 'dom') and duration (in milliseconds) when code assist is activated
25+
* The number of results (e.g. 20), whether an error occurred (e.g. false), and duration (in milliseconds) when code assist is activated
2626
* Whether the language server ran out of memory and the maximum allocated memory at which that occurred (e.g. 200m)
2727

2828
## What's included in the general telemetry data

‎package.json‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -452,17 +452,6 @@
452452
"scope": "window",
453453
"order": 90
454454
},
455-
"java.jdt.ls.javac.enabled": {
456-
"type": "string",
457-
"enum": [
458-
"on",
459-
"off"
460-
],
461-
"default": "off",
462-
"markdownDescription": "[Experimental] Specify whether to enable Javac-based compilation in the language server. Requires running this extension with Java 25",
463-
"scope": "window",
464-
"order": 95
465-
},
466455
"java.jdt.ls.appcds.enabled": {
467456
"type": "string",
468457
"enum": [
@@ -1094,21 +1083,6 @@
10941083
"scope": "window",
10951084
"order": 10
10961085
},
1097-
"java.completion.engine": {
1098-
"type": "string",
1099-
"default": "ecj",
1100-
"description": "[Experimental] Select code completion engine",
1101-
"scope": "window",
1102-
"enum": [
1103-
"ecj",
1104-
"dom"
1105-
],
1106-
"markdownEnumDescriptions": [
1107-
"Use ECJ-based code completion engine (default)",
1108-
"Use (highly experimental) JDT DOM-based code completion engine (requires `java.jdt.ls.javac.enabled` to be `on`)"
1109-
],
1110-
"order": 1000
1111-
},
11121086
"java.completion.postfix.enabled": {
11131087
"type": "boolean",
11141088
"default": true,

‎src/extension.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,6 @@ export function registerCodeCompletionTelemetryListener() {
13181318
resultLength: traceEvent.resultLength || 0,
13191319
error: !!traceEvent.error,
13201320
fromSyntaxServer: !!traceEvent.fromSyntaxServer,
1321-
engine: getJavaConfiguration().get('completion.engine'),
13221321
};
13231322
return Telemetry.sendTelemetry(Telemetry.COMPLETION_EVENT, props);
13241323
}

‎src/javaServerStarter.ts‎

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -172,61 +172,6 @@ function prepareParams(requirements: RequirementsData, workspacePath, context: E
172172
'java.base/sun.nio.fs=ALL-UNNAMED'
173173
);
174174

175-
const javacEnabled = 'on' === getJavaConfiguration().get('jdt.ls.javac.enabled');
176-
if (javacEnabled) {
177-
// Javac flags
178-
params.push(
179-
'--add-opens',
180-
'jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED',
181-
'--add-opens',
182-
'jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED',
183-
'--add-opens',
184-
'jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
185-
'--add-opens',
186-
'jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED',
187-
'--add-opens',
188-
'jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED',
189-
'--add-opens',
190-
'jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED',
191-
'--add-opens',
192-
'jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED',
193-
'--add-opens',
194-
'jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED',
195-
'--add-opens',
196-
'jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.taglets.snippet=ALL-UNNAMED',
197-
'--add-opens',
198-
'jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.taglets=ALL-UNNAMED',
199-
'--add-opens',
200-
'jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED',
201-
'--add-opens',
202-
'jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED',
203-
'--add-opens',
204-
'jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED',
205-
'--add-opens',
206-
'jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED',
207-
'--add-opens',
208-
'jdk.compiler/com.sun.tools.javac.resources=ALL-UNNAMED',
209-
'--add-opens',
210-
'java.base/sun.nio.ch=ALL-UNNAMED',
211-
'--add-opens',
212-
'jdk.zipfs/jdk.nio.zipfs=ALL-UNNAMED',
213-
'--add-opens',
214-
'java.compiler/javax.tools=ALL-UNNAMED',
215-
'--add-opens',
216-
'java.base/java.nio.channels=ALL-UNNAMED',
217-
'-DICompilationUnitResolver=org.eclipse.jdt.core.dom.JavacCompilationUnitResolver',
218-
'-DAbstractImageBuilder.compilerFactory=org.eclipse.jdt.internal.javac.JavacCompilerFactory',
219-
'-DCompilationUnit.DOM_BASED_OPERATIONS=true',
220-
'-DSourceIndexer.DOM_BASED_INDEXER=true',
221-
'-DMatchLocator.DOM_BASED_MATCH=true',
222-
'-DIJavaSearchDelegate=org.eclipse.jdt.internal.core.search.DOMJavaSearchDelegate',
223-
);
224-
225-
if('dom' === getJavaConfiguration().get('completion.engine')){
226-
params.push('-DCompilationUnit.codeComplete.DOM_BASED_OPERATIONS=true');
227-
};
228-
}
229-
230175
params.push('-Declipse.application=org.eclipse.jdt.ls.core.id1',
231176
'-Dosgi.bundles.defaultStartLevel=4',
232177
'-Declipse.product=org.eclipse.jdt.ls.core.product');

‎src/settings.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ function hasJavaConfigChanged(oldConfig: WorkspaceConfiguration, newConfig: Work
138138
|| hasConfigKeyChanged('sharedIndexes.location', oldConfig, newConfig)
139139
|| hasConfigKeyChanged('transport', oldConfig, newConfig)
140140
|| hasConfigKeyChanged('diagnostic.filter', oldConfig, newConfig)
141-
|| hasConfigKeyChanged('jdt.ls.javac.enabled', oldConfig, newConfig)
142-
|| hasConfigKeyChanged('completion.engine', oldConfig, newConfig)
143141
|| hasConfigKeyChanged('jdt.ls.appcds.enabled', oldConfig, newConfig);
144142
}
145143

‎src/utils.ts‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -251,19 +251,6 @@ export async function getJavaConfig(javaHome: string, skipAutoDetection?: boolea
251251
break;
252252
}
253253

254-
const javacSupport = javaConfig.jdt.ls.javac.enabled;
255-
switch (javacSupport) {
256-
case "on":
257-
javaConfig.jdt.ls.javac.enabled = true;
258-
break;
259-
case "off":
260-
javaConfig.jdt.ls.javac.enabled = false;
261-
break;
262-
default:
263-
javaConfig.jdt.ls.javac.enabled = false;
264-
break;
265-
}
266-
267254
if (javaConfig.completion.matchCase === "auto") {
268255
javaConfig.completion.matchCase = "firstLetter";
269256
}

0 commit comments

Comments
 (0)