Merge branch 'main' into unborked-git-zed2-diagnostics-view
This commit is contained in:
commit
3655a96e54
128 changed files with 16288 additions and 2752 deletions
|
@ -1,9 +1,8 @@
|
|||
use collections::{CommandPaletteFilter, HashMap};
|
||||
use fuzzy::{StringMatch, StringMatchCandidate};
|
||||
use gpui::{
|
||||
actions, div, prelude::*, Action, AppContext, Component, Div, EventEmitter, FocusHandle,
|
||||
Keystroke, ParentComponent, Render, Styled, View, ViewContext, VisualContext, WeakView,
|
||||
WindowContext,
|
||||
actions, div, prelude::*, Action, AppContext, Component, Dismiss, Div, FocusHandle, Keystroke,
|
||||
ManagedView, ParentComponent, Render, Styled, View, ViewContext, VisualContext, WeakView,
|
||||
};
|
||||
use picker::{Picker, PickerDelegate};
|
||||
use std::{
|
||||
|
@ -16,7 +15,7 @@ use util::{
|
|||
channel::{parse_zed_link, ReleaseChannel, RELEASE_CHANNEL},
|
||||
ResultExt,
|
||||
};
|
||||
use workspace::{Modal, ModalEvent, Workspace};
|
||||
use workspace::Workspace;
|
||||
use zed_actions::OpenZedURL;
|
||||
|
||||
actions!(Toggle);
|
||||
|
@ -47,7 +46,7 @@ impl CommandPalette {
|
|||
.available_actions()
|
||||
.into_iter()
|
||||
.filter_map(|action| {
|
||||
let name = action.name();
|
||||
let name = gpui::remove_the_2(action.name());
|
||||
let namespace = name.split("::").next().unwrap_or("malformed action name");
|
||||
if filter.is_some_and(|f| f.filtered_namespaces.contains(namespace)) {
|
||||
return None;
|
||||
|
@ -69,10 +68,9 @@ impl CommandPalette {
|
|||
}
|
||||
}
|
||||
|
||||
impl EventEmitter<ModalEvent> for CommandPalette {}
|
||||
impl Modal for CommandPalette {
|
||||
fn focus(&self, cx: &mut WindowContext) {
|
||||
self.picker.update(cx, |picker, cx| picker.focus(cx));
|
||||
impl ManagedView for CommandPalette {
|
||||
fn focus_handle(&self, cx: &AppContext) -> FocusHandle {
|
||||
self.picker.focus_handle(cx)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -268,7 +266,7 @@ impl PickerDelegate for CommandPaletteDelegate {
|
|||
|
||||
fn dismissed(&mut self, cx: &mut ViewContext<Picker<Self>>) {
|
||||
self.command_palette
|
||||
.update(cx, |_, cx| cx.emit(ModalEvent::Dismissed))
|
||||
.update(cx, |_, cx| cx.emit(Dismiss))
|
||||
.log_err();
|
||||
}
|
||||
|
||||
|
@ -457,7 +455,7 @@ mod tests {
|
|||
fn init_test(cx: &mut TestAppContext) -> Arc<AppState> {
|
||||
cx.update(|cx| {
|
||||
let app_state = AppState::test(cx);
|
||||
theme::init(cx);
|
||||
theme::init(theme::LoadThemes::JustBase, cx);
|
||||
language::init(cx);
|
||||
editor::init(cx);
|
||||
workspace::init(app_state.clone(), cx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue