From 8432b713cc53984c2ecf09cae7de038abd2d5443 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Mon, 13 Nov 2023 13:16:05 -0500 Subject: [PATCH] Resolve errors Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com> --- crates/command_palette2/src/command_palette.rs | 9 ++++++--- crates/picker2/src/picker2.rs | 2 +- crates/storybook2/src/stories/picker.rs | 4 ++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/crates/command_palette2/src/command_palette.rs b/crates/command_palette2/src/command_palette.rs index 508707f2648b6aa4c1145a6b761f3aa31a6f1dd8..c7a6c9ee834b81685ca94a0227202a97daaeae8d 100644 --- a/crates/command_palette2/src/command_palette.rs +++ b/crates/command_palette2/src/command_palette.rs @@ -2,11 +2,14 @@ use collections::{CommandPaletteFilter, HashMap}; use fuzzy::{StringMatch, StringMatchCandidate}; use gpui::{ actions, div, Action, AppContext, Component, Div, EventEmitter, FocusHandle, Keystroke, - ParentElement, Render, SharedString, StatelessInteractive, Styled, View, ViewContext, - VisualContext, WeakView, WindowContext, + ParentElement, Render, StatelessInteractive, Styled, View, ViewContext, VisualContext, + WeakView, WindowContext, }; use picker::{Picker, PickerDelegate}; -use std::cmp::{self, Reverse}; +use std::{ + cmp::{self, Reverse}, + sync::Arc, +}; use theme::ActiveTheme; use ui::{v_stack, HighlightedLabel, StyledExt}; use util::{ diff --git a/crates/picker2/src/picker2.rs b/crates/picker2/src/picker2.rs index 1c42e2ed3f13dfe5f5cf81fcb1097fbfbd044e88..0a731b4a27027b59e43f4a8a39f654ad241839c3 100644 --- a/crates/picker2/src/picker2.rs +++ b/crates/picker2/src/picker2.rs @@ -4,7 +4,7 @@ use gpui::{ StatelessInteractive, Styled, Task, UniformListScrollHandle, View, ViewContext, VisualContext, WindowContext, }; -use std::cmp; +use std::{cmp, sync::Arc}; use ui::{prelude::*, v_stack, Divider, Label, LabelColor}; pub struct Picker { diff --git a/crates/storybook2/src/stories/picker.rs b/crates/storybook2/src/stories/picker.rs index 82a010e6b30e820681b903232b74c35cad6b8584..067c190575acebad345479b88fe6cf164c19ef81 100644 --- a/crates/storybook2/src/stories/picker.rs +++ b/crates/storybook2/src/stories/picker.rs @@ -44,6 +44,10 @@ impl PickerDelegate for Delegate { self.candidates.len() } + fn placeholder_text(&self) -> Arc { + "Test".into() + } + fn render_match( &self, ix: usize,