Merge branch 'main' into search2

This commit is contained in:
Piotr Osiewicz 2023-11-20 19:23:35 +01:00
commit d60855b06d
108 changed files with 2988 additions and 1900 deletions

View file

@ -7,9 +7,9 @@ use crate::{
use anyhow::Result;
use collections::{HashMap, HashSet, VecDeque};
use gpui::{
actions, prelude::*, Action, AppContext, AsyncWindowContext, Component, Div, EntityId,
EventEmitter, FocusHandle, Focusable, FocusableView, Model, Pixels, Point, PromptLevel, Render,
Task, View, ViewContext, VisualContext, WeakView, WindowContext,
actions, prelude::*, Action, AppContext, AsyncWindowContext, Div, EntityId, EventEmitter,
FocusHandle, Focusable, FocusableView, Model, Pixels, Point, PromptLevel, Render, Task, View,
ViewContext, VisualContext, WeakView, WindowContext,
};
use parking_lot::Mutex;
use project2::{Project, ProjectEntryId, ProjectPath};
@ -594,7 +594,7 @@ impl Pane {
self.items.iter()
}
pub fn items_of_type<T: Render>(&self) -> impl '_ + Iterator<Item = View<T>> {
pub fn items_of_type<T: Render<T>>(&self) -> impl '_ + Iterator<Item = View<T>> {
self.items
.iter()
.filter_map(|item| item.to_any().downcast().ok())
@ -1344,7 +1344,7 @@ impl Pane {
item: &Box<dyn ItemHandle>,
detail: usize,
cx: &mut ViewContext<'_, Pane>,
) -> impl Component<Self> {
) -> impl RenderOnce<Self> {
let label = item.tab_content(Some(detail), cx);
let close_icon = || {
let id = item.item_id();
@ -1437,7 +1437,7 @@ impl Pane {
)
}
fn render_tab_bar(&mut self, cx: &mut ViewContext<'_, Pane>) -> impl Component<Self> {
fn render_tab_bar(&mut self, cx: &mut ViewContext<'_, Pane>) -> impl RenderOnce<Self> {
div()
.group("tab_bar")
.id("tab_bar")
@ -1891,7 +1891,7 @@ impl FocusableView for Pane {
}
}
impl Render for Pane {
impl Render<Self> for Pane {
type Element = Focusable<Self, Div<Self>>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
@ -2945,7 +2945,7 @@ struct DraggedTab {
title: String,
}
impl Render for DraggedTab {
impl Render<Self> for DraggedTab {
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {