Enable search within diagnostics pane (#22213)

Michael Sloan created

Closes #16033
Addresses one part of #4475

Release Notes:

- Added support for find and replace in diagnostics. Also causes
keybindings that use search to now work (such as `*` and `#` vim
bindings).

Change summary

crates/diagnostics/src/diagnostics.rs | 5 +++++
1 file changed, 5 insertions(+)

Detailed changes

crates/diagnostics/src/diagnostics.rs 🔗

@@ -41,6 +41,7 @@ use ui::{h_flex, prelude::*, Icon, IconName, Label};
 use util::ResultExt;
 use workspace::{
     item::{BreadcrumbText, Item, ItemEvent, ItemHandle, TabContentParams},
+    searchable::SearchableItemHandle,
     ItemNavHistory, ToolbarItemLocation, Workspace,
 };
 
@@ -810,6 +811,10 @@ impl Item for ProjectDiagnosticsEditor {
         }
     }
 
+    fn as_searchable(&self, _: &View<Self>) -> Option<Box<dyn SearchableItemHandle>> {
+        Some(Box::new(self.editor.clone()))
+    }
+
     fn breadcrumb_location(&self, _: &AppContext) -> ToolbarItemLocation {
         ToolbarItemLocation::PrimaryLeft
     }