diff --git a/crates/flycheck/src/test_runner.rs b/crates/flycheck/src/test_runner.rs index b7d966989b9b..6dac5899ee3a 100644 --- a/crates/flycheck/src/test_runner.rs +++ b/crates/flycheck/src/test_runner.rs @@ -14,6 +14,7 @@ use crate::command::{CommandHandle, ParseFromLine}; pub enum TestState { Started, Ok, + Ignored, Failed { stdout: String }, } diff --git a/crates/rust-analyzer/src/lsp/ext.rs b/crates/rust-analyzer/src/lsp/ext.rs index 842e765d9d15..86ab652f8ef5 100644 --- a/crates/rust-analyzer/src/lsp/ext.rs +++ b/crates/rust-analyzer/src/lsp/ext.rs @@ -171,7 +171,7 @@ pub struct DiscoverTestParams { #[derive(Deserialize, Serialize, Debug)] #[serde(rename_all = "camelCase")] -pub enum TestItemIcon { +pub enum TestItemKind { Package, Module, Test, @@ -182,7 +182,7 @@ pub enum TestItemIcon { pub struct TestItem { pub id: String, pub label: String, - pub icon: TestItemIcon, + pub kind: TestItemKind, pub can_resolve_children: bool, pub parent: Option, pub text_document: Option, diff --git a/crates/rust-analyzer/src/lsp/to_proto.rs b/crates/rust-analyzer/src/lsp/to_proto.rs index f0bb7d8af3ab..e2b55f4a5c5b 100644 --- a/crates/rust-analyzer/src/lsp/to_proto.rs +++ b/crates/rust-analyzer/src/lsp/to_proto.rs @@ -1506,10 +1506,10 @@ pub(crate) fn test_item( lsp_ext::TestItem { id: test_item.id, label: test_item.label, - icon: match test_item.kind { - ide::TestItemKind::Crate => lsp_ext::TestItemIcon::Package, - ide::TestItemKind::Module => lsp_ext::TestItemIcon::Module, - ide::TestItemKind::Function => lsp_ext::TestItemIcon::Test, + kind: match test_item.kind { + ide::TestItemKind::Crate => lsp_ext::TestItemKind::Package, + ide::TestItemKind::Module => lsp_ext::TestItemKind::Module, + ide::TestItemKind::Function => lsp_ext::TestItemKind::Test, }, can_resolve_children: matches!( test_item.kind, diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index 99c00d0384a4..bca6db19dcf9 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs @@ -779,6 +779,7 @@ impl GlobalState { flycheck::CargoTestMessage::Test { name, state } => { let state = match state { flycheck::TestState::Started => lsp_ext::TestState::Started, + flycheck::TestState::Ignored => lsp_ext::TestState::Skipped, flycheck::TestState::Ok => lsp_ext::TestState::Passed, flycheck::TestState::Failed { stdout } => { lsp_ext::TestState::Failed { message: stdout } diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md index 17e2eb5da5cd..af5b4e51ef37 100644 --- a/docs/dev/lsp-extensions.md +++ b/docs/dev/lsp-extensions.md @@ -1,5 +1,5 @@