From 9be4803462a3e2103bc03c6bde68b80d9233872e Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Wed, 25 Nov 2026 14:36:43 +0800 Subject: [PATCH] feat(run): stream the Java before-launch build to the status bar and Build window (#5801) The before-launch build of a Java Run / Debug launch now streams its output, messages and progress: java_resolve_launch takes a BuildEvent channel, launches joining a shared Maven build receive its events, and the frontend shows a cancellable status bar task, the build's commands in the run console and the full output in the Build tool window. Closes #5780 Refs #4078 --- crates/ide-build/src/compile/mod.rs | 40 +++++++--- crates/ide-host/src/mcp/run/configs.rs | 1 + crates/ide-host/src/ops/java.rs | 51 ++++++++++-- crates/ide-host/src/ops/java/cache.rs | 80 ++++++++++++++----- crates/ide-host/tests/workspaces.rs | 23 +++++- src/bindings.ts | 4 +- src/features/build/build.test.tsx | 61 ++++++++++++++ src/features/build/store.ts | 71 ++++++++++++++++ src/features/debugger/__tests__/java.test.ts | 13 ++- .../debugger/__tests__/javaCancel.test.ts | 6 ++ .../debugger/__tests__/javaSeparator.test.ts | 6 ++ src/features/debugger/actions.ts | 2 + src/features/run/applicationUpdate.test.ts | 10 ++- src/features/run/applicationUpdate.ts | 17 ++-- src/features/run/javaModule.test.ts | 16 ++-- src/features/run/store.ts | 2 + src/features/run/tomcat.test.tsx | 8 +- src/features/run/tomcat.ts | 14 +++- src/platform/javaLaunch.ts | 39 ++++++++- src/platform/locales/text/es.json | 1 + src/platform/locales/text/fr.json | 1 + src/platform/locales/text/ko.json | 1 + src/platform/locales/text/pl.json | 1 + src/platform/locales/text/pt.json | 1 + src/platform/locales/text/ru.json | 1 + src/platform/locales/text/tr.json | 1 + src/platform/locales/text/zh-TW.json | 1 + src/platform/locales/text/zh.json | 1 + 28 files changed, 406 insertions(+), 67 deletions(-) diff --git a/crates/ide-build/src/compile/mod.rs b/crates/ide-build/src/compile/mod.rs index 532beeff91..b565973c39 100644 --- a/crates/ide-build/src/compile/mod.rs +++ b/crates/ide-build/src/compile/mod.rs @@ -965,6 +965,7 @@ pub struct LaunchBuild { /// Compiles the module at `module` with its build system before a JVM launch and /// returns the class directories it wrote, to put ahead of the jdtls classpath. +/// The build's console, messages and progress stream to `on_event` as it runs. pub fn build_for_launch( root: &Path, model: &BuildModel, @@ -972,8 +973,9 @@ pub fn build_for_launch( test: bool, kind: BuildKind, cancel: &CancellationToken, + on_event: &(dyn Fn(BuildEvent) + Sync), ) -> IdeResult { - let mut built = build_for_launches(root, model, &[module.to_path_buf()], test, kind, cancel)?; + let mut built = build_for_launches(root, model, &[module.to_path_buf()], test, kind, cancel, on_event)?; Ok(built.pop().unwrap()) } @@ -986,9 +988,10 @@ pub fn build_for_launches( test: bool, kind: BuildKind, cancel: &CancellationToken, + on_event: &(dyn Fn(BuildEvent) + Sync), ) -> IdeResult> { let plan = merged_launch_plan(root, model, modules, test, kind, cancel)?; - let result = run(root, &plan, cancel, &|_| {})?; + let result = run(root, &plan, cancel, on_event)?; let failure = if !result.success { let errors: Vec = result .messages @@ -1822,8 +1825,16 @@ mod tests { std::fs::set_permissions(&wrapper, std::fs::Permissions::from_mode(0o755)).unwrap(); let mut model = reactor_model(); model.maven.as_mut().unwrap().projects[0].command = wrapper.to_string_lossy().into_owned(); - let dirs = build_for_launch(root, &model, &root.join("app"), true, BuildKind::Build, &CancellationToken::new()) - .unwrap(); + let dirs = build_for_launch( + root, + &model, + &root.join("app"), + true, + BuildKind::Build, + &CancellationToken::new(), + &|_| {}, + ) + .unwrap(); assert_eq!( dirs.class_dirs, ["app/target/test-classes", "app/target/classes", "middle/target/classes", "lib/target/classes"] @@ -1834,16 +1845,25 @@ mod tests { "mvnw", "#!/bin/sh\necho '[ERROR] Kotlin compilation failed: unresolved reference broken' >&2\nexit 1\n", ); - let error = - build_for_launch(root, &model, &root.join("app"), false, BuildKind::Build, &CancellationToken::new()) - .unwrap() - .failure - .unwrap(); + let error = build_for_launch( + root, + &model, + &root.join("app"), + false, + BuildKind::Build, + &CancellationToken::new(), + &|_| {}, + ) + .unwrap() + .failure + .unwrap(); assert!(error.contains("Kotlin compilation failed"), "{error}"); let cancel = CancellationToken::new(); cancel.cancel(); assert_eq!( - build_for_launch(root, &model, &root.join("app"), false, BuildKind::Build, &cancel).unwrap_err().kind, + build_for_launch(root, &model, &root.join("app"), false, BuildKind::Build, &cancel, &|_| {}) + .unwrap_err() + .kind, ide_core::error::ErrorKind::Cancelled ); } diff --git a/crates/ide-host/src/mcp/run/configs.rs b/crates/ide-host/src/mcp/run/configs.rs index ce3a510a62..3240c65729 100644 --- a/crates/ide-host/src/mcp/run/configs.rs +++ b/crates/ide-host/src/mcp/run/configs.rs @@ -515,6 +515,7 @@ async fn resolve_jvm_application( test == Some(true), policy, &cancel, + None, ) .await?; use ide_lsp::jdtls::JavaBuildStatus; diff --git a/crates/ide-host/src/ops/java.rs b/crates/ide-host/src/ops/java.rs index c58512ddc0..9818c9d141 100644 --- a/crates/ide-host/src/ops/java.rs +++ b/crates/ide-host/src/ops/java.rs @@ -4,9 +4,11 @@ pub(crate) mod cache; use crate::Host; use ide_command::command; +use super::Channel; use super::build::{load, with_profiles, workspace}; +use cache::LaunchEvents; use ide_build::BuildModel; -use ide_build::compile; +use ide_build::compile::{self, BuildEvent}; use ide_core::error::ErrorKind; use ide_core::settings::Settings; use ide_core::{CancellationToken, IdeError, IdeResult, RequestId}; @@ -18,6 +20,8 @@ use std::path::{Path, PathBuf}; /// Builds according to `policy`, then resolves the runtime (or test) /// classpath and the JDK of the module at `module` (absolute, or relative to the project root). /// A module with Kotlin / Groovy / Scala sources is built by its build system, whose class directories come first. +/// The build streams its console, messages and progress on `on_event` while it runs; a launch +/// whose build another launch's build joins receives that build's events. #[command(trust = trusted)] pub async fn java_resolve_launch( host: &Host, @@ -26,12 +30,16 @@ pub async fn java_resolve_launch( test: bool, policy: BuildPolicy, request: RequestId, + on_event: Channel, ) -> IdeResult { // Resources a Gradle build filters or renames are processed by Gradle, replacing the language // server's plain copies. host.require_trust(window)?; let cancel = host.begin_project_request(window, request); - let result = resolve_launch(host, window, module, test, policy, &cancel).await; + let events: LaunchEvents = std::sync::Arc::new(move |event| { + let _ = on_event.send(event); + }); + let result = resolve_launch(host, window, module, test, policy, &cancel, Some(events)).await; host.end_request(request); result } @@ -43,8 +51,15 @@ pub(crate) async fn resolve_launch( test: bool, policy: BuildPolicy, cancel: &CancellationToken, + events: Option, ) -> IdeResult { let started = std::time::Instant::now(); + let progress = |message: &str| { + if let Some(events) = &events { + events(BuildEvent::Progress { message: message.to_owned(), fraction: None }); + } + }; + progress("Resolving the module"); let project = host.project(window)?; let module = ide_core::project_roots::resolve(&project.root, &module); let scope = { @@ -54,11 +69,11 @@ pub(crate) async fn resolve_launch( .map_err(|e| IdeError::internal(e.to_string()))?? }; if !project.lsp.java_served_by_jdtls(&module) { - return resolve_launch_without_jdtls(host, &project, module, scope, test, policy, cancel).await; + return resolve_launch_without_jdtls(host, &project, module, scope, test, policy, cancel, events).await; } let scope = std::sync::Arc::new(scope); let launches = project.java_launches.for_cache(&scope.cache); - let waiting = launches.waiting.add(module.clone(), test, policy); + let waiting = launches.waiting.add(module.clone(), test, policy, events.clone()); let prefer_maven = scope.settings.languages.java.maven.delegate_build; // A launch builds incrementally unless the configuration asks for Rebuild or NoBuild. let build = policy != BuildPolicy::NoBuild; @@ -90,6 +105,9 @@ pub(crate) async fn resolve_launch( }; let mut external_build = if delegated { Some(project.lsp.java_external_build(&module, cancel).await?) } else { None }; + if build && !delegated { + progress("Compiling with the Java language server"); + } let mut info = project.lsp.java_launch(&module, test, build && !delegated, full, delegated, cancel).await?; if info.errors.iter().any(|e| processor_recreated_a_file(&e.message)) { if build && !delegated && is_maven { @@ -118,6 +136,11 @@ pub(crate) async fn resolve_launch( tokio::task::spawn_blocking(move || { let _external_build = external_build; let (root, cache, settings) = (&scope.root, &scope.cache, &scope.settings); + let on_event = |event: BuildEvent| { + if let Some(events) = &events { + events(event); + } + }; let local_repo = ide_sdk::apply::maven_local_repository(root, settings); // Module outputs the launch runs from a snapshot of: the originals must not come back. let mut snapshotted = Vec::new(); @@ -130,7 +153,7 @@ pub(crate) async fn resolve_launch( root, &model, &module, - cache::BuildOptions { test, policy, rebuild_on_jdt_errors, members }, + cache::BuildOptions { test, policy, rebuild_on_jdt_errors, members, events: events.clone() }, local_repo.clone(), &cancel, )?; @@ -140,7 +163,7 @@ pub(crate) async fn resolve_launch( snapshotted = outputs.originals; copies } else if external { - let built = compile::build_for_launch(root, &model, &module, test, build_kind, &cancel)?; + let built = compile::build_for_launch(root, &model, &module, test, build_kind, &cancel, &on_event)?; if let Some(failure) = built.failure { if policy != BuildPolicy::MakeAndContinueOnErrors { return Err(IdeError::internal(failure)); @@ -154,6 +177,7 @@ pub(crate) async fn resolve_launch( }; let mut class_paths: Vec = built.iter().map(|p| p.to_string_lossy().into_owned()).collect(); if delegated { + on_event(BuildEvent::Progress { message: "Resolving the classpath".into(), fraction: None }); // m2e runs inside jdtls on the server JDK and can resolve a different // Maven profile/classifier than the module build. Ask the same Maven // process that built the module for its runtime/test dependencies. @@ -203,6 +227,7 @@ fn is_maven_module(root: &Path, model: &BuildModel, module: &Path) -> bool { /// A launch of a module jdtls doesn't serve (another Java language server, or none): the /// build tool compiles it, and the classpath comes from that server, else from Maven. +#[allow(clippy::too_many_arguments)] async fn resolve_launch_without_jdtls( host: &Host, project: &std::sync::Arc, @@ -211,18 +236,24 @@ async fn resolve_launch_without_jdtls( test: bool, policy: BuildPolicy, cancel: &CancellationToken, + events: Option, ) -> IdeResult { let started = std::time::Instant::now(); let scope = std::sync::Arc::new(scope); let kind = if policy == BuildPolicy::Rebuild { compile::BuildKind::Rebuild } else { compile::BuildKind::Build }; let (model, built) = { - let (scope, module, cancel) = (scope.clone(), module.clone(), cancel.clone()); + let (scope, module, cancel, events) = (scope.clone(), module.clone(), cancel.clone(), events.clone()); tokio::task::spawn_blocking(move || { let model = load_launch_model(&scope); + let on_event = |event: BuildEvent| { + if let Some(events) = &events { + events(event); + } + }; let built = if policy == BuildPolicy::NoBuild { None } else { - Some(compile::build_for_launch(&scope.root, &model, &module, test, kind, &cancel)) + Some(compile::build_for_launch(&scope.root, &model, &module, test, kind, &cancel, &on_event)) }; (model, built) }) @@ -254,6 +285,9 @@ async fn resolve_launch_without_jdtls( } } let build_ms = started.elapsed().as_millis(); + if let Some(events) = &events { + events(BuildEvent::Progress { message: "Resolving the classpath".into(), fraction: None }); + } let from_server = project.lsp.java_server_classpath(&module, test, cancel).await?; let data_dir = host.local_data_dir.clone(); let cancel = cancel.clone(); @@ -474,6 +508,7 @@ async fn build_members( members.push(cache::Member { module: launch.module.clone(), rebuild_on_jdt_errors: rebuild_on_jdt_errors(launch.policy, prefer_maven, errors), + events: launch.events.clone(), }); } Ok(members) diff --git a/crates/ide-host/src/ops/java/cache.rs b/crates/ide-host/src/ops/java/cache.rs index adab331aac..7cd3894190 100644 --- a/crates/ide-host/src/ops/java/cache.rs +++ b/crates/ide-host/src/ops/java/cache.rs @@ -1,5 +1,5 @@ //! Immutable Maven outputs retained in the project cache, including across close/reopen. -use ide_build::compile::{self, LaunchFingerprint}; +use ide_build::compile::{self, BuildEvent, LaunchFingerprint}; use ide_core::{CancellationToken, IdeError, IdeResult}; use ide_run::BuildPolicy; use parking_lot::Mutex; @@ -131,6 +131,10 @@ pub(super) fn has_record(root: &Path, cache: &Path, module: &Path) -> bool { [false, true].into_iter().any(|test| record_path(root, cache, module, test).is_some_and(|record| record.is_file())) } +/// Where the build of a launch streams its console, messages and progress: the run +/// console, the status bar and the Build tool window of the launch's request. +pub(in crate::ops) type LaunchEvents = Arc; + #[derive(Default)] pub(super) struct BuildOptions { pub test: bool, @@ -142,13 +146,15 @@ pub(super) struct BuildOptions { /// together, #3971): their modules join this Maven run, and their launches then reuse /// the snapshots recorded here instead of running Maven again. pub members: Vec, + /// The launch's own events; members that join the build get them too. + pub events: Option, } /// A launch module joining another launch's build; see [`BuildOptions::members`]. -#[derive(Debug)] pub(super) struct Member { pub module: PathBuf, pub rebuild_on_jdt_errors: bool, + pub events: Option, } /// Launches share a build only within the same workspace project's cache. @@ -180,11 +186,12 @@ impl Sessions { #[derive(Default)] pub(crate) struct Waiting(Arc>>>); -#[derive(Debug)] pub(super) struct WaitingLaunch { pub module: PathBuf, pub test: bool, pub policy: BuildPolicy, + /// The launch's build events, for a build it joins. + pub events: Option, } /// Leaves [`Waiting`] when dropped. @@ -194,8 +201,14 @@ pub(super) struct WaitingGuard { } impl Waiting { - pub(super) fn add(&self, module: PathBuf, test: bool, policy: BuildPolicy) -> WaitingGuard { - let launch = Arc::new(WaitingLaunch { module, test, policy }); + pub(super) fn add( + &self, + module: PathBuf, + test: bool, + policy: BuildPolicy, + events: Option, + ) -> WaitingGuard { + let launch = Arc::new(WaitingLaunch { module, test, policy, events }); self.0.lock().push(launch.clone()); WaitingGuard { all: self.0.clone(), launch } } @@ -266,7 +279,7 @@ impl Session { cancel: &CancellationToken, ) -> IdeResult { self.initialize(); - let BuildOptions { test, policy, rebuild_on_jdt_errors, members } = options; + let BuildOptions { test, policy, rebuild_on_jdt_errors, members, events } = options; let mut lead = match self.prepare(root, model, module, test, policy, &local_repo, cancel)? { Ok(outputs) => return Ok(outputs), Err(pending) => pending, @@ -284,11 +297,13 @@ impl Session { let policy = if rebuild_on_jdt_errors { BuildPolicy::Rebuild } else { policy }; let mut joined = Vec::new(); let mut rebuild = policy == BuildPolicy::Rebuild; + let mut sinks: Vec = events.into_iter().collect(); for member in members { if let Err(pending) = self.prepare(root, model, &member.module, test, BuildPolicy::Make, &local_repo, cancel)? { rebuild |= member.rebuild_on_jdt_errors; + sinks.extend(member.events); joined.push(pending); } } @@ -298,7 +313,13 @@ impl Session { tracing::info!(?modules, "Building the launch modules in one Maven run"); } let kind = if rebuild { compile::BuildKind::Rebuild } else { compile::BuildKind::Build }; - let mut built = compile::build_for_launches(root, model, &modules, test, kind, cancel)?.into_iter(); + // Every launch waiting for this build follows it. + let on_event = |event: BuildEvent| { + for sink in &sinks { + sink(event.clone()); + } + }; + let mut built = compile::build_for_launches(root, model, &modules, test, kind, cancel, &on_event)?.into_iter(); let lead_built = built.next().unwrap(); for (pending, built) in joined.into_iter().zip(built) { match built.failure { @@ -648,10 +669,31 @@ mod tests { let mut session = Session::new(root.join("cache")); let (a, b) = (root.join("a"), root.join("b")); let with = |rebuild_on_jdt_errors: bool| BuildOptions { - members: vec![Member { module: b.clone(), rebuild_on_jdt_errors }], + members: vec![Member { module: b.clone(), rebuild_on_jdt_errors, events: None }], ..Default::default() }; - let lead = session.build(root, &model, &a, with(false), None, &cancel).unwrap(); + // The lead's and the member's launches both follow the shared build. + let seen = Arc::new(Mutex::new(Vec::new())); + let sink = |name: &'static str| -> LaunchEvents { + let seen = seen.clone(); + Arc::new(move |event| { + if let BuildEvent::Step { command, .. } = event { + seen.lock().push(format!("{name}: {command}")); + } + }) + }; + let options = BuildOptions { + members: vec![Member { module: b.clone(), rebuild_on_jdt_errors: false, events: Some(sink("b")) }], + events: Some(sink("a")), + ..Default::default() + }; + let lead = session.build(root, &model, &a, options, None, &cancel).unwrap(); + let seen = seen.lock().clone(); + assert_eq!(seen.len(), 2, "{seen:?}"); + assert!( + seen[0].starts_with("a: ") && seen[1].starts_with("b: ") && seen[0].contains("-pl a,b -am"), + "{seen:?}" + ); assert_eq!(fs::read_to_string(lead.snapshot.join("0/Main.class")).unwrap(), "a"); assert_eq!(fs::read_to_string(lead.snapshot.join("1/Main.class")).unwrap(), "lib"); // b's own launch runs from the snapshot the shared build recorded for it. @@ -690,17 +732,17 @@ mod tests { let root = dir.path(); let model = reactor_fixture(root); let waiting = Waiting::default(); - let lead = waiting.add(root.join("a"), false, BuildPolicy::Automatic); + let lead = waiting.add(root.join("a"), false, BuildPolicy::Automatic, None); let _guards = [ - waiting.add(root.join("b"), false, BuildPolicy::Make), - waiting.add(root.join("lib"), false, BuildPolicy::Automatic), - waiting.add(root.join("b"), false, BuildPolicy::Automatic), - waiting.add(root.join("a"), false, BuildPolicy::Automatic), - waiting.add(root.join("lib"), true, BuildPolicy::Automatic), - waiting.add(root.join("lib"), false, BuildPolicy::Rebuild), - waiting.add(root.join("lib"), false, BuildPolicy::MakeAndContinueOnErrors), - waiting.add(root.join("lib"), false, BuildPolicy::NoBuild), - waiting.add(root.join("other"), false, BuildPolicy::Automatic), + waiting.add(root.join("b"), false, BuildPolicy::Make, None), + waiting.add(root.join("lib"), false, BuildPolicy::Automatic, None), + waiting.add(root.join("b"), false, BuildPolicy::Automatic, None), + waiting.add(root.join("a"), false, BuildPolicy::Automatic, None), + waiting.add(root.join("lib"), true, BuildPolicy::Automatic, None), + waiting.add(root.join("lib"), false, BuildPolicy::Rebuild, None), + waiting.add(root.join("lib"), false, BuildPolicy::MakeAndContinueOnErrors, None), + waiting.add(root.join("lib"), false, BuildPolicy::NoBuild, None), + waiting.add(root.join("other"), false, BuildPolicy::Automatic, None), ]; let join = |prefer_maven| { super::super::joining_launches( diff --git a/crates/ide-host/tests/workspaces.rs b/crates/ide-host/tests/workspaces.rs index ab1ab71e0d..6bdf91c979 100644 --- a/crates/ide-host/tests/workspaces.rs +++ b/crates/ide-host/tests/workspaces.rs @@ -85,9 +85,26 @@ done for (index, root) in roots.into_iter().enumerate() { let module = if root == &sibling { root.join("app") } else { root.strip_prefix(&primary).unwrap().join("app") }; let test = index != 0; - let info = ops::java::java_resolve_launch(&host, "main", module, test, BuildPolicy::Make, RequestId::next()) - .await - .unwrap(); + let events = std::sync::Arc::new(std::sync::Mutex::new(Vec::new())); + let sink = events.clone(); + let channel = ops::Channel::new(move |event: ide_build::compile::BuildEvent| sink.lock().unwrap().push(event)); + let info = + ops::java::java_resolve_launch(&host, "main", module, test, BuildPolicy::Make, RequestId::next(), channel) + .await + .unwrap(); + // The build streams its command and progress while it runs. + use ide_build::compile::BuildEvent; + let events = events.lock().unwrap(); + assert!( + events.iter().any(|e| matches!(e, BuildEvent::Step { command, .. } if command.contains("-pl app -am"))), + "{events:?}" + ); + assert!( + events + .iter() + .any(|e| matches!(e, BuildEvent::Progress { message, .. } if message == "Resolving the classpath")), + "{events:?}" + ); let out = root.join("app/target").join(if test { "test-classes" } else { "classes" }); let jar = root.join("app").join(if test { "test.jar" } else { "runtime.jar" }); assert!(info.class_paths.iter().any(|p| std::path::Path::new(p) == out)); diff --git a/src/bindings.ts b/src/bindings.ts index 126eb6bb7f..c4e757402d 100644 --- a/src/bindings.ts +++ b/src/bindings.ts @@ -847,8 +847,10 @@ export const commands = { * Builds according to `policy`, then resolves the runtime (or test) * classpath and the JDK of the module at `module` (absolute, or relative to the project root). * A module with Kotlin / Groovy / Scala sources is built by its build system, whose class directories come first. + * The build streams its console, messages and progress on `on_event` while it runs; a launch + * whose build another launch's build joins receives that build's events. */ - javaResolveLaunch: (module: string, test: boolean, policy: BuildPolicy, request: RequestId) => typedError(__TAURI_INVOKE("java_resolve_launch", { module, test, policy, request })), + javaResolveLaunch: (module: string, test: boolean, policy: BuildPolicy, request: RequestId, onEvent: Channel) => typedError(__TAURI_INVOKE("java_resolve_launch", { module, test, policy, request, onEvent })), /** * Downloads the latest `vendor` JDK of Java `version` into `location` (default: * [`jdk_download_location`]), streaming progress through `on_event`; cancellable diff --git a/src/features/build/build.test.tsx b/src/features/build/build.test.tsx index 2f3a4f0c51..d9b91c27b4 100644 --- a/src/features/build/build.test.tsx +++ b/src/features/build/build.test.tsx @@ -34,6 +34,7 @@ import { } from "./model"; import { BUILD_TASK_ID, + followLaunchBuild, rerunBuild, setBuildBackend, startBuild, @@ -686,4 +687,64 @@ describe("build feature", () => { ); expect(screen.getByRole("document", { name: "Build message" })).toHaveTextContent("cannot find symbol"); }); + + it("follows a launch's build: status bar progress, its commands in the console, its output in Build", async () => { + vi.useFakeTimers(); + try { + const report = vi.fn(); + const follower = followLaunchBuild(42 as never, "Build before launch: App", report); + follower.onEvent({ kind: "progress", message: "Resolving the module", fraction: null }); + expect(useTasks.getState().tasks.find((t) => t.id === "launch-build:42")).toMatchObject({ + title: "Build before launch: App", + message: "Resolving the module", + }); + follower.onEvent({ kind: "started", system: "maven", title: "demo: build module 'app'" }); + follower.onEvent({ kind: "step", command: "mvn -pl app -am compile", cwd: "/p" }); + follower.onEvent({ kind: "output", text: "[INFO] Building app 1 [2/2]\n", stderr: false }); + follower.onEvent({ kind: "progress", message: "Building app", fraction: 0.5 }); + follower.onEvent({ kind: "message", message: err("/p/app/A.java", 3) }); + vi.advanceTimersByTime(20); + expect(report).toHaveBeenCalledWith("mvn -pl app -am compile\n", "system"); + expect(useTasks.getState().tasks.find((t) => t.id === "launch-build:42")).toMatchObject({ + message: "Building app", + fraction: 0.5, + }); + expect(useBuildRun.getState()).toMatchObject({ + request: 42, + status: "running", + title: "demo: build module 'app'", + }); + expect(useBuildRun.getState().lines.map((l) => l.text)).toEqual([ + "mvn -pl app -am compile", + "[INFO] Building app 1 [2/2]", + ]); + // A launch build stays out of sight at start, as Build before launch does. + expect(show).not.toHaveBeenCalled(); + // Cancel in the status bar cancels the launch's request. + useTasks.getState().tasks.find((t) => t.id === "launch-build:42")!.cancel!(); + expect(fake.cancelled).toEqual([42]); + follower.finish("failed"); + expect(useBuildRun.getState()).toMatchObject({ request: null, status: "failed" }); + expect(getContext()["build.running"]).toBe(false); + expect(show).toHaveBeenCalledWith("build", false); + expect(openFile).toHaveBeenCalledWith("/p/app/A.java", expect.objectContaining({ focus: true })); + } finally { + vi.useRealTimers(); + } + }); + + it("leaves the Build window to a build that is already running", async () => { + void startBuild("build"); + await act(async () => {}); + const running = useBuildRun.getState().request; + const follower = followLaunchBuild(43 as never, "Build before launch: App"); + follower.onEvent({ kind: "started", system: "maven", title: "launch" }); + follower.onEvent({ kind: "output", text: "launch output\n", stderr: false }); + follower.finish("success"); + expect(useBuildRun.getState().request).toBe(running); + expect(useBuildRun.getState().lines.some((l) => l.text === "launch output")).toBe(false); + await act(async () => { + fake.resolve(result([], true)); + }); + }); }); diff --git a/src/features/build/store.ts b/src/features/build/store.ts index a7bf60f49c..a1f90321f5 100644 --- a/src/features/build/store.ts +++ b/src/features/build/store.ts @@ -317,6 +317,77 @@ async function executeBuild( return result; } +/** Follows the build of a Run / Debug launch: see {@link followLaunchBuild}. */ +export interface LaunchBuildFollower { + onEvent(e: BuildEvent): void; + /** The launch's build is over (the launch itself may still fail later). */ + finish(status: BuildStatus): void; +} + +/** + * Follows the before-launch build of a Java launch (`javaResolveLaunch`), as IDEA shows it: + * progress (the phase, the Maven module being built) as a cancellable status bar task, the + * commands it runs in the launch's console (`report`), and, when no other build is running, + * its whole output in the Build tool window, which opens per Settings › Compiler like any + * before-launch build. Cancelling cancels `request`, which stops the build and the launch. + */ +export function followLaunchBuild( + request: RequestId, + title: string, + report?: (text: string, kind?: "system" | "stderr") => void, +): LaunchBuildFollower { + const taskId = `launch-build:${request}`; + const cancel = () => backend.cancel(request); + let owned = false; + let done = false; + const ownsBuild = () => owned && useBuildRun.getState().request === request; + let queue: BuildEvent[] = []; + let timer: ReturnType | undefined; + const flush = () => { + clearTimeout(timer); + timer = undefined; + const events = queue; + queue = []; + if (!ownsBuild() || !events.length) return; + let s = useBuildRun.getState(); + for (const e of events) s = { ...s, ...applyBuildEvent(s, e) }; + useBuildRun.setState(s); + }; + const take = () => { + if (owned || isBuilding()) return; + owned = true; + const previous = useBuildRun.getState().files; + useBuildRun.setState({ ...INITIAL, request, kind: "build", title, status: "running", files: previous }); + setContext(BUILD_LAST_STATUS, null); + setContext(BUILD_RUNNING, true); + showBuildWindow("start", false); + }; + return { + onEvent(e) { + if (done) return; + if (e.kind === "progress") + upsertTask({ id: taskId, title, message: e.message, fraction: e.fraction, done: false, cancel }); + if (e.kind === "started") take(); + if (e.kind === "step") report?.(`${e.command}\n`, "system"); + if (!ownsBuild()) return; + queue.push(e); + timer ??= setTimeout(flush, 16); + }, + finish(status) { + if (done) return; + done = true; + upsertTask({ id: taskId, title, message: null, fraction: 1, done: true }); + if (!ownsBuild()) return; + flush(); + const { messages } = useBuildRun.getState(); + useBuildRun.setState({ status, request: null, message: null }); + setContext(BUILD_LAST_STATUS, status); + setContext(BUILD_RUNNING, false); + if (status === "failed" && messages.length) showFailure(); + }, + }; +} + /** Opens the source of a build message; `focus` moves focus to the editor (otherwise a preview). */ export function navigateToMessage(m: BuildMessage, focus: boolean) { if (!m.path) return; diff --git a/src/features/debugger/__tests__/java.test.ts b/src/features/debugger/__tests__/java.test.ts index 2f6e4172cc..b4b46fc243 100644 --- a/src/features/debugger/__tests__/java.test.ts +++ b/src/features/debugger/__tests__/java.test.ts @@ -7,6 +7,12 @@ let kotlinFiles = false; let debugAdapter = "java-debug"; const files: Record = {}; let missingTools: string[] = []; +vi.mock("@tauri-apps/api/core", async (original) => ({ + ...(await original()), + Channel: class { + onmessage = null; + }, +})); vi.mock("@/platform/ipc", async (orig) => { const real = await orig(); const ok = (data: unknown) => Promise.resolve({ status: "ok", data }); @@ -93,7 +99,7 @@ describe("Java debugging (java-debug through jdtls)", () => { expect(isJavaDebuggable({ ...app, kind: "maven" })).toBe(false); const l = await javaLaunchConfig(app, "/p"); expect(invoked).toEqual([ - ["javaResolveLaunch", ["api", false, "automatic", expect.any(Number)]], + ["javaResolveLaunch", ["api", false, "automatic", expect.any(Number), expect.anything()]], ["javaDebugAdapter", ["api"]], ["javaDebugServer", ["api"]], ]); @@ -232,7 +238,10 @@ it.each(["sibling", "/outside/modules"])("debugs from %s with the main class mod invoked.length = 0; // oxlint-disable-next-line no-await-in-loop -- invoked is a shared call log reset each iteration; the assertions must follow the matching launch const launch = await javaLaunchConfig({ ...app, module, cwd }, "/p"); - expect(invoked).toContainEqual(["javaResolveLaunch", ["api", false, "automatic", expect.any(Number)]]); + expect(invoked).toContainEqual([ + "javaResolveLaunch", + ["api", false, "automatic", expect.any(Number), expect.anything()], + ]); expect(invoked).toContainEqual(["javaDebugServer", ["api"]]); expect(launch.cwd).toBe(cwd.startsWith("/") ? cwd : `/p/${cwd}`); } diff --git a/src/features/debugger/__tests__/javaCancel.test.ts b/src/features/debugger/__tests__/javaCancel.test.ts index 86f8fa7e4f..7e646620a0 100644 --- a/src/features/debugger/__tests__/javaCancel.test.ts +++ b/src/features/debugger/__tests__/javaCancel.test.ts @@ -15,6 +15,12 @@ const ipc = vi.hoisted(() => ({ debugStop: vi.fn(async () => ({ status: "ok", data: null })), fsReadDir: vi.fn(async () => ({ status: "ok", data: [] })), })); +vi.mock("@tauri-apps/api/core", async (original) => ({ + ...(await original()), + Channel: class { + onmessage = null; + }, +})); vi.mock("@/platform/ipc", async (original) => { const real = await original(); return { ...real, isTauri: () => true, commands: { ...real.commands, ...ipc } }; diff --git a/src/features/debugger/__tests__/javaSeparator.test.ts b/src/features/debugger/__tests__/javaSeparator.test.ts index 506e22435b..bc8a2cc392 100644 --- a/src/features/debugger/__tests__/javaSeparator.test.ts +++ b/src/features/debugger/__tests__/javaSeparator.test.ts @@ -8,6 +8,12 @@ const ipc = vi.hoisted(() => ({ javaDebugServer: vi.fn(async () => ({ status: "ok", data: 5005 })), fsReadDir: vi.fn(async () => ({ status: "ok", data: [] })), })); +vi.mock("@tauri-apps/api/core", async (original) => ({ + ...(await original()), + Channel: class { + onmessage = null; + }, +})); vi.mock("@/platform/ipc", async (importOriginal) => ({ ...(await importOriginal()), commands: ipc, diff --git a/src/features/debugger/actions.ts b/src/features/debugger/actions.ts index 9a3622db6a..d2a4474959 100644 --- a/src/features/debugger/actions.ts +++ b/src/features/debugger/actions.ts @@ -13,6 +13,7 @@ import { type RunId, } from "@/platform/ipc"; import { downloadJdkActions } from "@/platform/jdk"; +import { followLaunchBuild } from "@/features/build/store"; import { useProject } from "@/platform/project"; import { isRemoteWindow } from "@/platform/remote"; import { openExternalUrl } from "@/platform/openUrl"; @@ -383,6 +384,7 @@ async function startJavaConfig(config: RunConfig, root: string, origin: RunConfi request, signal, report, + build: followLaunchBuild(request, tx`Build before launch: ${config.name}`, report), saveAll: async () => { await maybeEditorService()?.saveAll(); }, diff --git a/src/features/run/applicationUpdate.test.ts b/src/features/run/applicationUpdate.test.ts index 8984a4ce1b..433c60745c 100644 --- a/src/features/run/applicationUpdate.test.ts +++ b/src/features/run/applicationUpdate.test.ts @@ -21,6 +21,12 @@ const mocks = vi.hoisted(() => ({ buildListeners: new Set<(event: unknown) => void>(), state: { configs: [] as RunSession["config"][], sessions: [] as RunSession[], activeSession: null as string | null }, })); +vi.mock("@tauri-apps/api/core", async (original) => ({ + ...(await original()), + Channel: class { + onmessage = null; + }, +})); vi.mock("@/platform/actions", () => ({ executeAction: mocks.action, getAction: () => ({}) })); vi.mock("@/platform/ipc", () => ({ call: async (p: Promise<{ data: unknown }>) => (await p).data, @@ -141,7 +147,7 @@ const boot = { describe("Spring Boot application updates", () => { it("processes resources and publishes them to the resolved runtime output", async () => { await updateTomcat(boot, "resources"); - expect(mocks.resolve).toHaveBeenCalledWith("app", false, "noBuild", 1); + expect(mocks.resolve).toHaveBeenCalledWith("app", false, "noBuild", 1, expect.anything()); expect(mocks.runBuild).toHaveBeenCalledWith({ id: "build" }); expect(mocks.publish).toHaveBeenCalledWith(boot.config, ["/p/app/bin/main"], "a.Main"); expect(mocks.update).not.toHaveBeenCalled(); @@ -149,7 +155,7 @@ describe("Spring Boot application updates", () => { }); it("compiles and invokes the existing scoped HotSwap action in debug", async () => { await updateTomcat(boot, "classes"); - expect(mocks.resolve).toHaveBeenCalledWith("app", false, "make", 1); + expect(mocks.resolve).toHaveBeenCalledWith("app", false, "make", 1, expect.anything()); expect(mocks.action).toHaveBeenCalledWith("debug.reloadChangedClasses", { configId: "boot" }); }); it("explains compiled classes require restart without a debugger", async () => { diff --git a/src/features/run/applicationUpdate.ts b/src/features/run/applicationUpdate.ts index f1d2dd57d0..22f6904c5f 100644 --- a/src/features/run/applicationUpdate.ts +++ b/src/features/run/applicationUpdate.ts @@ -3,7 +3,8 @@ import { create } from "zustand"; import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow"; import { executeAction, getAction } from "@/platform/actions"; import { call, commands, isTauri, nextRequestId, type RunConfig } from "@/platform/ipc"; -import { parseJavaArgs, resolveJavaModule } from "@/platform/javaLaunch"; +import { parseJavaArgs, resolveJavaLaunch, resolveJavaModule } from "@/platform/javaLaunch"; +import { followLaunchBuild } from "@/features/build/store"; import { maybeEditorService, notifications, @@ -46,13 +47,13 @@ async function updateSpringBoot(config: RunConfig, mode: UpdateMode, debugging: const module = await resolveJavaModule(config); const parsed = parseJavaArgs(config.args); if (!parsed.mainClass) throw new Error(tx("The Spring Boot configuration has no main class")); - const info = await call( - commands.javaResolveLaunch( - module, - parsed.classpath === "test", - mode === "classes" ? "make" : "noBuild", - nextRequestId(), - ), + const request = nextRequestId(); + const info = await resolveJavaLaunch( + module, + parsed.classpath === "test", + mode === "classes" ? "make" : "noBuild", + request, + followLaunchBuild(request, tx`Build before launch: ${config.name}`), ); if (info.build === "failed" || info.build === "withErrors" || info.build === "cancelled") throw updateBuildError(info); diff --git a/src/features/run/javaModule.test.ts b/src/features/run/javaModule.test.ts index 24959da378..12edd5a552 100644 --- a/src/features/run/javaModule.test.ts +++ b/src/features/run/javaModule.test.ts @@ -84,7 +84,7 @@ afterEach(() => { it.each(["sibling", "/outside/modules"])("runs from %s using the stored module's classpath", async (cwd) => { const session = await startRun({ ...config, module: "app", cwd }); expect(session?.status).toBe("running"); - expect(ipc.javaResolveLaunch).toHaveBeenCalledWith("app", false, "automatic", expect.any(Number)); + expect(ipc.javaResolveLaunch).toHaveBeenCalledWith("app", false, "automatic", expect.any(Number), expect.anything()); expect(ipc.runStart).toHaveBeenCalledWith( expect.objectContaining({ cwd, args: ["-cp", "/p/app/target/classes", "a.Main"] }), expect.anything(), @@ -108,13 +108,13 @@ const launchInfo = (build: "succeeded" | "failed" | "withErrors") => ({ it.each(["noBuild", "rebuild"] as const)("passes the %s build policy to the resolver", async (buildPolicy) => { await startRun({ ...config, module: "app", buildPolicy }); - expect(ipc.javaResolveLaunch).toHaveBeenCalledWith("app", false, buildPolicy, expect.any(Number)); + expect(ipc.javaResolveLaunch).toHaveBeenCalledWith("app", false, buildPolicy, expect.any(Number), expect.anything()); }); it("always applies the launch policy after a Before launch Build Project", async () => { useProject.setState({ project: { root: "/p" } as never }); await startRun({ ...config, module: "app" }); - expect(ipc.javaResolveLaunch).toHaveBeenCalledWith("app", false, "automatic", expect.any(Number)); + expect(ipc.javaResolveLaunch).toHaveBeenCalledWith("app", false, "automatic", expect.any(Number), expect.anything()); useProject.setState({ project: null }); }); @@ -145,7 +145,7 @@ it.each([undefined, "automatic", "make", "rebuild"] as const)( it("finds the source module for an old saved configuration without a module", async () => { await startRun({ ...config, cwd: "/outside/modules" }); expect(ipc.findFiles).toHaveBeenCalledWith("Main.java", 1000); - expect(ipc.javaResolveLaunch).toHaveBeenCalledWith("app", false, "automatic", expect.any(Number)); + expect(ipc.javaResolveLaunch).toHaveBeenCalledWith("app", false, "automatic", expect.any(Number), expect.anything()); expect(ipc.runStart).toHaveBeenCalledWith( expect.objectContaining({ cwd: "/outside/modules" }), expect.anything(), @@ -166,7 +166,7 @@ it.each([null, "/elsewhere"])("recovers an attached module from its indexed path }); const session = await startRun({ ...config, cwd }); expect(session?.status).toBe("running"); - expect(ipc.javaResolveLaunch).toHaveBeenCalledWith(module, false, "automatic", expect.any(Number)); + expect(ipc.javaResolveLaunch).toHaveBeenCalledWith(module, false, "automatic", expect.any(Number), expect.anything()); expect(ipc.runStart).toHaveBeenCalledWith( expect.objectContaining({ cwd: cwd ?? module, module }), expect.anything(), @@ -184,7 +184,7 @@ it.each([["-cp", "lib/*"], []])("colours Spring Boot runs without classpath reso expect.anything(), expect.any(Number), ); - expect(ipc.javaResolveLaunch).toHaveBeenCalledWith("app", false, "automatic", expect.any(Number)); + expect(ipc.javaResolveLaunch).toHaveBeenCalledWith("app", false, "automatic", expect.any(Number), expect.anything()); expect(boot.args).toBe(args); expect(args).not.toContain("-Dspring.output.ansi.enabled=always"); }); @@ -193,14 +193,14 @@ it.each(["never", "detect", "always"])("preserves an explicit Spring Boot consol const args = [`-Dspring.output.ansi.enabled=${value}`, "-cp", "lib/*", "a.Main"]; await startRun({ ...config, kind: "spring-boot", args }); expect(ipc.runStart).toHaveBeenCalledWith(expect.objectContaining({ args }), expect.anything(), expect.any(Number)); - expect(ipc.javaResolveLaunch).toHaveBeenCalledWith("app", false, "automatic", expect.any(Number)); + expect(ipc.javaResolveLaunch).toHaveBeenCalledWith("app", false, "automatic", expect.any(Number), expect.anything()); }); it("keeps plain Java runs with an explicit classpath free of Spring Boot options", async () => { const args = ["-cp", "lib/*", "a.Main"]; await startRun({ ...config, args }); expect(ipc.runStart).toHaveBeenCalledWith(expect.objectContaining({ args }), expect.anything(), expect.any(Number)); - expect(ipc.javaResolveLaunch).toHaveBeenCalledWith("app", false, "automatic", expect.any(Number)); + expect(ipc.javaResolveLaunch).toHaveBeenCalledWith("app", false, "automatic", expect.any(Number), expect.anything()); }); it("adds the Spring Boot console option once when resolving the module classpath", async () => { diff --git a/src/features/run/store.ts b/src/features/run/store.ts index 1a442b65d4..2a827c120d 100644 --- a/src/features/run/store.ts +++ b/src/features/run/store.ts @@ -70,6 +70,7 @@ import { tomcatBrowserUrl } from "./tomcat"; import { gradleBootLaunch, gradleDelegation, gradleTestLaunch } from "./gradleRun"; import { openUrl } from "./navigate"; import { tx, txPart } from "@/platform/i18n"; +import { followLaunchBuild } from "@/features/build/store"; import { UNITY_CONFIG_KIND } from "./unity"; /** The permanent "Current File" pseudo-configuration of the chooser (runs the active file's context). */ @@ -1231,6 +1232,7 @@ async function resolveJvmApplication(sessionId: string, config: RunConfig): Prom request: request.id, signal: request.controller.signal, report: say, + build: followLaunchBuild(request.id, tx`Build before launch: ${config.name}`, say), saveAll: async () => { await maybeEditorService()?.saveAll(); }, diff --git a/src/features/run/tomcat.test.tsx b/src/features/run/tomcat.test.tsx index 9f67d7b8ad..654fdd8518 100644 --- a/src/features/run/tomcat.test.tsx +++ b/src/features/run/tomcat.test.tsx @@ -16,6 +16,12 @@ import { typeRows } from "./AddConfigPopup"; import { commands, type RunConfig } from "@/platform/ipc"; import { useProject } from "@/platform/project"; +vi.mock("@tauri-apps/api/core", async (original) => ({ + ...(await original()), + Channel: class { + onmessage = null; + }, +})); vi.mock("@/platform/ipc", async (importOriginal) => ({ ...(await importOriginal()), commands: { @@ -286,7 +292,7 @@ describe("updating a running Tomcat deployment", () => { it("compiles the selected WAR module and copies its outputs instead of rebuilding the WAR", async () => { const c = config({ deployment: "artifact", artifact: "maven:web/pom.xml" }); expect(await syncTomcatOutputs(c, false)).toBe(true); - expect(commands.javaResolveLaunch).toHaveBeenCalledWith("web", false, "make", expect.anything()); + expect(commands.javaResolveLaunch).toHaveBeenCalledWith("web", false, "make", expect.anything(), expect.anything()); expect(commands.runTomcatSync).toHaveBeenCalledWith(c, "web", ["/p/web/target/classes", "/m2/lib.jar"], false); }); diff --git a/src/features/run/tomcat.ts b/src/features/run/tomcat.ts index 7adbe83161..10e59c6f7d 100644 --- a/src/features/run/tomcat.ts +++ b/src/features/run/tomcat.ts @@ -1,4 +1,7 @@ import { call, commands, nextRequestId, type RunConfig } from "@/platform/ipc"; +import { tx } from "@/platform/i18n"; +import { resolveJavaLaunch } from "@/platform/javaLaunch"; +import { followLaunchBuild } from "@/features/build/store"; import type { RunConfigTypeContribution } from "@/workbench/contributions"; import { updatePolicyDefaults, updatePolicyFields } from "./updatePolicies"; import { runUpdateBuild, updateBuildError } from "./buildUpdate"; @@ -258,10 +261,15 @@ export async function syncTomcatOutputs( const p = deployment.params ?? {}; const artifact = p.artifact ? artifacts.find((a) => a.id === p.artifact) : artifacts[0]; if (!artifact) return false; + const request = nextRequestId(); // oxlint-disable-next-line no-await-in-loop -- deployments compile and copy in turn - const info = await call(commands.javaResolveLaunch(artifact.module, false, buildPolicy, nextRequestId())).catch( - () => null, - ); + const info = await resolveJavaLaunch( + artifact.module, + false, + buildPolicy, + request, + followLaunchBuild(request, tx`Build before launch: ${config.name}`), + ).catch(() => null); if (!info) return false; if (info.build === "failed" || info.build === "withErrors" || info.build === "cancelled") throw updateBuildError(info); diff --git a/src/platform/javaLaunch.ts b/src/platform/javaLaunch.ts index a6ca7a3781..1be4a26e72 100644 --- a/src/platform/javaLaunch.ts +++ b/src/platform/javaLaunch.ts @@ -4,10 +4,13 @@ * `${classpath}` (or `${testClasspath}`) and the `java` launcher are resolved * through jdtls when the configuration starts. */ +import { Channel } from "@tauri-apps/api/core"; import { call, commands, IpcError, + isCancelled, + type BuildEvent, type BuildPolicy, type JavaLaunchInfo, type JunitLaunch, @@ -247,6 +250,34 @@ export interface JavaPreparation { policy?: BuildPolicy; /** Saves open documents first, as IDEA's Before launch does. */ saveAll?: () => Promise; + /** Follows the build while it runs (status bar, Build tool window); see `followLaunchBuild`. */ + build?: JavaBuildFollower; +} + +/** Receives the events of a launch's build as it runs, then its outcome. */ +export interface JavaBuildFollower { + onEvent(e: BuildEvent): void; + finish(status: "success" | "failed" | "cancelled"): void; +} + +/** `javaResolveLaunch`, streaming the build's events to `build`, which then gets the outcome. */ +export async function resolveJavaLaunch( + module: string, + test: boolean, + policy: BuildPolicy, + request: RequestId, + build?: JavaBuildFollower, +): Promise { + const channel = new Channel(); + channel.onmessage = (e) => build?.onEvent(e); + try { + const info = await call(commands.javaResolveLaunch(module, test, policy, request, channel)); + build?.finish(info.build === "failed" ? "failed" : info.build === "cancelled" ? "cancelled" : "success"); + return info; + } catch (e) { + build?.finish(isCancelled(e) ? "cancelled" : "failed"); + throw e; + } } /** The build the launch would do: the configuration's policy, else incremental. */ @@ -268,8 +299,12 @@ export async function prepareJavaLaunch(config: RunConfig, preparation: JavaPrep const started = performance.now(); const module = await prepareJavaModule(config, preparation.saveAll, signal); const moduleMs = performance.now() - started; - const info = await call( - commands.javaResolveLaunch(module, parsed.classpath === "test", policy, preparation.request), + const info = await resolveJavaLaunch( + module, + parsed.classpath === "test", + policy, + preparation.request, + preparation.build, ).catch((error: unknown) => { if (error instanceof IpcError && error.data?.type === "javaBuildProblems") { const problems = error.data.problems.join("; "); diff --git a/src/platform/locales/text/es.json b/src/platform/locales/text/es.json index 71de7b2174..d031c93345 100644 --- a/src/platform/locales/text/es.json +++ b/src/platform/locales/text/es.json @@ -3459,6 +3459,7 @@ "What should the agent do?": "¿Qué debe hacer el agente?", "New worktree": "Nuevo árbol de trabajo", "Building and resolving the classpath of {name}…": "Compilando y resolviendo el classpath de {name}…", + "Build before launch: {name}": "Compilación antes de ejecutar: {name}", "The classpath is empty: is the module imported by the Java language server?": "El classpath está vacío: ¿el servidor de lenguaje Java importó el módulo?", "Launch cancelled.": "Inicio cancelado.", "Starting debugger for {name}…": "Iniciando depurador para {name}…", diff --git a/src/platform/locales/text/fr.json b/src/platform/locales/text/fr.json index c0c1c394cc..88b6411021 100644 --- a/src/platform/locales/text/fr.json +++ b/src/platform/locales/text/fr.json @@ -3332,6 +3332,7 @@ "What should the agent do?": "Que doit faire l'agent ?", "New worktree": "Nouveau worktree", "Building and resolving the classpath of {name}…": "Compilation et résolution du classpath de {name}…", + "Build before launch: {name}": "Compilation avant le lancement : {name}", "The classpath is empty: is the module imported by the Java language server?": "Le classpath est vide : le module est-il importé par le serveur de langage Java ?", "Launch cancelled.": "Lancement annulé.", "Starting debugger for {name}…": "Démarrage du débogueur pour {name}…", diff --git a/src/platform/locales/text/ko.json b/src/platform/locales/text/ko.json index 4e4bc87307..a9294781a9 100644 --- a/src/platform/locales/text/ko.json +++ b/src/platform/locales/text/ko.json @@ -3509,6 +3509,7 @@ "What should the agent do?": "에이전트가 무엇을 해야 하나요?", "New worktree": "새 워크트리", "Building and resolving the classpath of {name}…": "{name}의 클래스 경로를 빌드하고 해결하는 중…", + "Build before launch: {name}": "실행 전 빌드: {name}", "The classpath is empty: is the module imported by the Java language server?": "클래스 경로가 비어 있습니다. Java 언어 서버에서 모듈을 가져왔습니까?", "Launch cancelled.": "실행이 취소되었습니다.", "Starting debugger for {name}…": "{name}의 디버거 시작 중…", diff --git a/src/platform/locales/text/pl.json b/src/platform/locales/text/pl.json index 7cf35c9b15..13517b1dba 100644 --- a/src/platform/locales/text/pl.json +++ b/src/platform/locales/text/pl.json @@ -3431,6 +3431,7 @@ "What should the agent do?": "Co agent powinien zrobić?", "New worktree": "Nowe worktree", "Building and resolving the classpath of {name}…": "Kompilowanie i ustalanie ścieżki klas (classpath) dla {name}…", + "Build before launch: {name}": "Kompilacja przed uruchomieniem: {name}", "The classpath is empty: is the module imported by the Java language server?": "Ścieżka klas jest pusta: czy moduł został zaimportowany przez serwer językowy Java?", "Launch cancelled.": "Uruchomienie anulowane.", "Starting debugger for {name}…": "Uruchamianie debugera dla {name}…", diff --git a/src/platform/locales/text/pt.json b/src/platform/locales/text/pt.json index c8e5d773a1..f18505be47 100644 --- a/src/platform/locales/text/pt.json +++ b/src/platform/locales/text/pt.json @@ -3432,6 +3432,7 @@ "What should the agent do?": "O que o agente deve fazer?", "New worktree": "Novo worktree", "Building and resolving the classpath of {name}…": "Compilando e resolvendo o classpath de {name}…", + "Build before launch: {name}": "Compilação antes da execução: {name}", "The classpath is empty: is the module imported by the Java language server?": "O classpath está vazio: o módulo foi importado pelo servidor de linguagem Java?", "Launch cancelled.": "Inicialização cancelada.", "Starting debugger for {name}…": "Iniciando o depurador para {name}…", diff --git a/src/platform/locales/text/ru.json b/src/platform/locales/text/ru.json index 1244434d49..61f5c169a7 100644 --- a/src/platform/locales/text/ru.json +++ b/src/platform/locales/text/ru.json @@ -4840,6 +4840,7 @@ "What should the agent do?": "Что должен сделать агент?", "New worktree": "Новый worktree", "Building and resolving the classpath of {name}…": "Сборка и разрешение classpath для {name}…", + "Build before launch: {name}": "Сборка перед запуском: {name}", "The classpath is empty: is the module imported by the Java language server?": "Classpath пуст: импортирован ли модуль языковым сервером Java?", "Launch cancelled.": "Запуск отменен.", "Starting debugger for {name}…": "Запуск отладчика для {name}…", diff --git a/src/platform/locales/text/tr.json b/src/platform/locales/text/tr.json index cdf90d7a5c..ba51ba700b 100644 --- a/src/platform/locales/text/tr.json +++ b/src/platform/locales/text/tr.json @@ -6162,6 +6162,7 @@ "What should the agent do?": "Ajan ne yapmalı?", "New worktree": "Yeni çalışma ağacı", "Building and resolving the classpath of {name}…": "{name} için sınıf yolu oluşturuluyor ve çözümleniyor…", + "Build before launch: {name}": "Başlatmadan önce derleme: {name}", "The classpath is empty: is the module imported by the Java language server?": "Sınıf yolu boş: modül Java dil sunucusu tarafından içe aktarıldı mı?", "Launch cancelled.": "Başlatma iptal edildi.", "Starting debugger for {name}…": "{name} için hata ayıklayıcı başlatılıyor…", diff --git a/src/platform/locales/text/zh-TW.json b/src/platform/locales/text/zh-TW.json index 3018a7f5c6..b546b30daa 100644 --- a/src/platform/locales/text/zh-TW.json +++ b/src/platform/locales/text/zh-TW.json @@ -4377,6 +4377,7 @@ "What should the agent do?": "讓 agent 做點什麼?", "New worktree": "新 worktree", "Building and resolving the classpath of {name}…": "正在建置並解析 {name} 的類路徑…", + "Build before launch: {name}": "啟動前建置:{name}", "The classpath is empty: is the module imported by the Java language server?": "類路徑為空:Java 語言伺服器是否已匯入此模組?", "Launch cancelled.": "啟動已取消。", "Starting debugger for {name}…": "正在啟動 {name} 的偵錯工具…", diff --git a/src/platform/locales/text/zh.json b/src/platform/locales/text/zh.json index ddb1f237d4..c3e6eca2ed 100644 --- a/src/platform/locales/text/zh.json +++ b/src/platform/locales/text/zh.json @@ -4898,6 +4898,7 @@ "What should the agent do?": "让 agent 做点什么?", "New worktree": "新 worktree", "Building and resolving the classpath of {name}…": "正在构建并解析 {name} 的类路径…", + "Build before launch: {name}": "启动前构建:{name}", "The classpath is empty: is the module imported by the Java language server?": "类路径为空:Java 语言服务器是否已导入此模块?", "Launch cancelled.": "启动已取消。", "Starting debugger for {name}…": "正在启动 {name} 的调试器…",