@@ -1516,8 +1516,8 @@ pub(crate) fn test_item(
15161516 snap : & GlobalStateSnapshot ,
15171517 test_item : ide:: TestItem ,
15181518 line_index : Option < & LineIndex > ,
1519- ) -> lsp_ext:: TestItem {
1520- lsp_ext:: TestItem {
1519+ ) -> Option < lsp_ext:: TestItem > {
1520+ Some ( lsp_ext:: TestItem {
15211521 id : test_item. id ,
15221522 label : test_item. label ,
15231523 kind : match test_item. kind {
@@ -1532,9 +1532,9 @@ pub(crate) fn test_item(
15321532 | project_model:: TargetKind :: Example
15331533 | project_model:: TargetKind :: BuildScript
15341534 | project_model:: TargetKind :: Other => lsp_ext:: TestItemKind :: Package ,
1535- project_model:: TargetKind :: Test | project_model :: TargetKind :: Bench => {
1536- lsp_ext :: TestItemKind :: Test
1537- }
1535+ project_model:: TargetKind :: Test => lsp_ext :: TestItemKind :: Test ,
1536+ // benches are not tests needed to be shown in the test explorer
1537+ project_model :: TargetKind :: Bench => return None ,
15381538 }
15391539 }
15401540 ide:: TestItemKind :: Module => lsp_ext:: TestItemKind :: Module ,
@@ -1550,7 +1550,7 @@ pub(crate) fn test_item(
15501550 . map ( |f| lsp_types:: TextDocumentIdentifier { uri : url ( snap, f) } ) ,
15511551 range : line_index. and_then ( |l| Some ( range ( l, test_item. text_range ?) ) ) ,
15521552 runnable : test_item. runnable . and_then ( |r| runnable ( snap, r) . ok ( ) ) ,
1553- }
1553+ } )
15541554}
15551555
15561556pub ( crate ) mod command {
0 commit comments