From 3aa5c14e3d92e688dae9b1a2fc0a71f31e4a96c9 Mon Sep 17 00:00:00 2001 From: lick <2188718831@qq.com> Date: Fri, 20 Nov 2026 10:51:49 -0800 Subject: [PATCH 1/2] fix(run): enable Java debugging for Maven application entrypoints --- io.github.lithe-idea.maven-build/plugin.json | 6 ++-- scripts/test.mjs | 30 ++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/io.github.lithe-idea.maven-build/plugin.json b/io.github.lithe-idea.maven-build/plugin.json index a2803f5..7110745 100644 --- a/io.github.lithe-idea.maven-build/plugin.json +++ b/io.github.lithe-idea.maven-build/plugin.json @@ -4,7 +4,7 @@ "displayName": "Maven", "version": "1.0.2", "pluginAPIVersion": 0, - "requires": {"buildSystems": 0, "buildProviders": 1, "projectGenerators": 0, "runConfigurationTypes": 0, "beforeLaunchTasks": 0, "settings": 0, "backend": 0, "sourceSettings": 0}, + "requires": {"buildSystems": 2, "buildProviders": 1, "projectGenerators": 0, "runConfigurationTypes": 0, "beforeLaunchTasks": 0, "settings": 0, "backend": 0, "sourceSettings": 0}, "vendor": {"id": "io.github.lithe-idea", "displayName": "Lithe Community", "signatureRequirement": "none"}, "permissions": ["process.build", "project.generate", "backend.launch", "languageServer.launch", "workspace.metadata"], "activationEvents": ["onBuildSystem:maven"], @@ -404,8 +404,8 @@ ], "run": [ {"id": "spring-boot", "source": "provider", "fromTargets": {"tags": ["spring-boot"]}, "execution": "service", "debug": {"configurationType": "java"}}, - {"id": "application", "source": "provider", "fromTargets": {"tags": ["java-application"]}, "execution": "application"}, - {"id": "main", "source": "provider", "entrypoints": true} + {"id": "application", "source": "provider", "fromTargets": {"tags": ["java-application"]}, "debug": {"configurationType": "java"}}, + {"id": "main", "source": "provider", "entrypoints": true, "debug": {"configurationType": "java"}} ] } ], diff --git a/scripts/test.mjs b/scripts/test.mjs index a85e28f..e8ad30a 100644 --- a/scripts/test.mjs +++ b/scripts/test.mjs @@ -201,6 +201,35 @@ async function prepareRuns(signal) { assert.ok(debug.arguments.indexOf("-cp") > debug.arguments.findIndex((argument) => argument.startsWith("-agentlib:jdwp"))); }); + await check("Debug prepares an ordinary application on the host's JDWP port", async () => { + const application = buildSystem.run.find((run) => run.id === "application"); + assert.equal(application.execution ?? "application", "application"); + assert.equal(application.debug?.configurationType, "java"); + const plan = await prepare({ name: "Main", path: "app", tags: ["java-application"], properties: { mainClass: "demo.app.Main" } }, { + launchOptions: { execution: application.execution ?? "application", runtimeArguments: ["-Dfixture=enabled"], arguments: ["fixture"], environment: { LITHE_FIXTURE: "set" }, + workingDirectory: "app", debug: { adapterID: "dev.example/java", configurationType: application.debug.configurationType, + target: { kind: "connection", host: "127.0.0.1", port: 51236 } } }, + }); + assert.equal(plan.workingDirectory, "app"); + assert.deepEqual(plan.environment, { LITHE_FIXTURE: "set" }); + assert.ok(plan.arguments.includes("-Dfixture=enabled")); + assert.ok(plan.arguments.includes("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:51236")); + assert.deepEqual(plan.arguments.slice(plan.arguments.indexOf("-cp") + 2), ["demo.app.Main", "fixture", "typed"]); + }); + + await check("Debug prepares a source entrypoint without a named target", async () => { + const main = buildSystem.run.find((run) => run.entrypoints); + assert.equal(main.debug?.configurationType, "java"); + const plan = await request({ path: "app", tags: [] }, { + run: main.id, target: undefined, userArguments: [], + launchOptions: { execution: "application", runtimeArguments: [], arguments: ["fixture"], environment: {}, + entrypoint: "demo.app.Main", debug: { adapterID: "dev.example/java", configurationType: main.debug.configurationType, + target: { kind: "connection", host: "127.0.0.1", port: 51237 } } }, + }); + assert.ok(plan.arguments.includes("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:51237")); + assert.deepEqual(plan.arguments.slice(plan.arguments.indexOf("-cp") + 2), ["demo.app.Main", "fixture"]); + }); + await check("a failed build ends preparation with the provider's error", async () => { writeFileSync(join(root, "service", "src", "main", "java", "demo", "service", "Broken.java"), "package demo.service; class Broken {"); try { @@ -424,6 +453,7 @@ async function test(signal) { assert.ok(buildSystem.run.every((run) => run.source === "provider")); assert.equal(runs.main.entrypoints, true, "Run on Current File starts any main class through the main run"); assert.equal(manifest.requires.buildProviders, 1); + assert.equal(manifest.requires.buildSystems, 2); }); const projectDependencies = await document("read project dependencies", buildSystem.dependencies, signal, { project: "app" }); From ef1b756206d02681d346264ce69f34ae7b44e0d7 Mon Sep 17 00:00:00 2001 From: lick <2188718831@qq.com> Date: Fri, 20 Nov 2026 11:11:41 -0800 Subject: [PATCH 2/2] test(maven): render compiler settings on a compatible desktop host --- compiler-host.json | 4 ++-- .../internal/settingswindow/plugin_native_source_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler-host.json b/compiler-host.json index 1ee8332..a5f6a86 100644 --- a/compiler-host.json +++ b/compiler-host.json @@ -1,6 +1,6 @@ { "repository": "https://github.com/1lck/Lithe-IDEA", - "revision": "e9ce7781f1a9635ced8a090b45a159af4f5ce959", - "coreRevision": "5802c42b5766df7375bd427c54203db415ff72d7", + "revision": "0d4e28fe4d4ebb6741a4faa30a0c7ec8c3c8609d", + "coreRevision": "39aa5fb51fcbc9c986536d1c48ab9665e4a68a62", "package": "io.github.lithe-idea.maven-build" } diff --git a/e2e/host/desktop/internal/settingswindow/plugin_native_source_test.go b/e2e/host/desktop/internal/settingswindow/plugin_native_source_test.go index a8b3fab..e6b14ab 100644 --- a/e2e/host/desktop/internal/settingswindow/plugin_native_source_test.go +++ b/e2e/host/desktop/internal/settingswindow/plugin_native_source_test.go @@ -100,8 +100,8 @@ func TestPluginNativeSourceVisual(t *testing.T) { fetch := func(context.Context) (marketplace.Snapshot, error) { return marketplace.Snapshot{Index: core.MarketplaceIndex{Plugins: []core.MarketplacePlugin{{ID: metadata.ID, Name: metadata.DisplayName, LatestVersion: metadata.Version}}}}, nil } - w := newWindow(NewController(Options{Text: func() *i18n.Messages { return i18n.For(language) }, Language: func() i18n.Language { return language }, SystemLanguage: language, SystemDark: func() bool { return theme == "dark" }, PluginSettings: source, SettingsNavigation: core.NewClient().SettingsNavigation, SettingsPages: func(ctx context.Context) ([]core.SettingsPage, error) { - return core.NewClient().SettingsPages(ctx, []core.SettingsContribution{{Manifest: manifest, Owner: core.PluginSettingsOwner{PluginID: metadata.ID, Version: metadata.Version}, Enabled: true}}) + w := newWindow(NewController(Options{Text: func() *i18n.Messages { return i18n.For(language) }, Language: func() i18n.Language { return language }, SystemLanguage: language, SystemDark: func() bool { return theme == "dark" }, PluginSettings: source, SettingsNavigation: core.NewClient().SettingsNavigation, SettingsPages: func(ctx context.Context, language i18n.Language) ([]core.SettingsPage, error) { + return core.NewClient().SettingsPages(ctx, []core.SettingsContribution{{Manifest: manifest, Owner: core.PluginSettingsOwner{PluginID: metadata.ID, Version: metadata.Version}, Enabled: true}}, language.Code()) }, Marketplace: fetch, MarketplaceInstalled: fetch, PluginState: func(string) PluginState { return PluginState{Installed: true, Enabled: true, Version: metadata.Version} }}), Values{Theme: theme, Language: language.Code()})