Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--crates/rust-analyzer/src/main_loop.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs
index 930c499c5f..bd213ffa57 100644
--- a/crates/rust-analyzer/src/main_loop.rs
+++ b/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::ChangeTestState>(
lsp_ext::ChangeTestStateParams { test_id, state },