@@ -1516,8 +1516,8 @@ pub(crate) fn test_item(
1516
1516
snap : & GlobalStateSnapshot ,
1517
1517
test_item : ide:: TestItem ,
1518
1518
line_index : Option < & LineIndex > ,
1519
- ) -> lsp_ext:: TestItem {
1520
- lsp_ext:: TestItem {
1519
+ ) -> Option < lsp_ext:: TestItem > {
1520
+ Some ( lsp_ext:: TestItem {
1521
1521
id : test_item. id ,
1522
1522
label : test_item. label ,
1523
1523
kind : match test_item. kind {
@@ -1532,9 +1532,9 @@ pub(crate) fn test_item(
1532
1532
| project_model:: TargetKind :: Example
1533
1533
| project_model:: TargetKind :: BuildScript
1534
1534
| 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 ,
1538
1538
}
1539
1539
}
1540
1540
ide:: TestItemKind :: Module => lsp_ext:: TestItemKind :: Module ,
@@ -1550,7 +1550,7 @@ pub(crate) fn test_item(
1550
1550
. map ( |f| lsp_types:: TextDocumentIdentifier { uri : url ( snap, f) } ) ,
1551
1551
range : line_index. and_then ( |l| Some ( range ( l, test_item. text_range ?) ) ) ,
1552
1552
runnable : test_item. runnable . and_then ( |r| runnable ( snap, r) . ok ( ) ) ,
1553
- }
1553
+ } )
1554
1554
}
1555
1555
1556
1556
pub ( crate ) mod command {
0 commit comments