From 35bb73aa8c362151a2719920494807ee6c1ebbc7 Mon Sep 17 00:00:00 2001 From: duncan Date: Fri, 11 Apr 2025 14:15:13 +0100 Subject: [PATCH] use underscores in the target name for test update notifications --- src/tools/rust-analyzer/crates/rust-analyzer/src/main_loop.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/main_loop.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/main_loop.rs index 930c499c5f1b..bd213ffa57a1 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/main_loop.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/main_loop.rs @@ -969,7 +969,9 @@ impl GlobalState { TestState::Ok => lsp_ext::TestState::Passed, TestState::Failed { stdout } => lsp_ext::TestState::Failed { message: stdout }, }; - let test_id = format!("{}::{name}", message.target.target); + + // The notification requires the namespace form (with underscores) of the target + let test_id = format!("{}::{name}", message.target.target.replace('-', "_")); self.send_notification::( lsp_ext::ChangeTestStateParams { test_id, state },