Repository navigation
Conversation
When another extension contributes a jar through contributes.javaExtensions that JDT LS already ships at the same version, the server fails to install it with "A bundle is already installed" on every start. collectJavaExtensions now leaves out a contributed jar when the server's plugins folder already has a jar with the same file name, and logs each skipped jar once per session. Fixes redhat-developer#4580 Signed-off-by: uiradev <83920075+uiradev@users.noreply.github.com>
|
Seems like a good idea; I'll do my best to take a quick look over this afternoon. Even though this works around it, t'd be nice if vscode-java-test adapted to the fact they don't need to ship the bundle causing the problem; I'll follow up with them. We're due for a release so it'd be nice if they get everything in order before then. |
| export function collectJavaExtensions(extensions: readonly vscode.Extension<any>[], serverPluginsDir: string = path.join(getServerHome(), 'plugins')): string[] { | ||
| const result = []; | ||
| if (extensions && extensions.length) { | ||
| const serverJars = listJars(serverPluginsDir); |
There was a problem hiding this comment.
This works pretty good if an extension to vscode-java ships a jar that overlaps with the jars shipped by vscode-java itself, but what if two extensions ship the same jar?
I think it might be worth addressing this case in this PR. If you don't have time for that though, just let me know; I'm happy to merge the PR as is, since it addresses the linked bug.
Thanks; I'll open a PR for that. |
Fixes #4580
When another extension contributes a jar through
contributes.javaExtensionsthat JDT LS already ships at the same version, the server fails to install it with "A bundle is already installed" on every start. Test Runner for Java 0.47.0 does this withorg.objectweb.asm_9.10.1.jar.Changes
collectJavaExtensions(src/plugin.ts) leaves out a contributed jar when the server'spluginsfolder already has a jar with the same file name. p2 names jars<symbolicName>_<version>.jar, so the same name means the same bundle at the same version. A jar with a different version is still passed on.collectJavaExtensionsruns several times per start (for example, while waiting for workspace trust).getServerHome()(src/javaServerStarter.ts) holds the server location rule, so the launcher and the bundle filter use the same folder.test/standard-mode-suite/extension.test.ts.Testing
npm run repo:check,npm run compile,npm run vscode:prepublish,vsce packageandnpm run eslintpass.SKIP_COMMANDS_TEST=true npm testpasses on macOS (Apple silicon): 14 lightweight and 55 standard tests passing, 2 pending.Note:
npm run eslintdoesn't lint the.tsfiles in this repo. With ESLint 10.7.0,files: ["src/**"]doesn't match them, and they're reported as "File ignored because no matching configuration was supplied". I linted the changed files with an extrasrc/**/*.tspattern, and they're clean.