Remove unused imports
This commit is contained in:
parent
898645681f
commit
4d87a67af8
5 changed files with 16 additions and 28 deletions
|
@ -40,7 +40,7 @@ use language::{language_settings::SoftWrap, Buffer, LanguageRegistry, ToOffset a
|
||||||
use project::Project;
|
use project::Project;
|
||||||
use search::{buffer_search::DivRegistrar, BufferSearchBar};
|
use search::{buffer_search::DivRegistrar, BufferSearchBar};
|
||||||
use semantic_index::{SemanticIndex, SemanticIndexStatus};
|
use semantic_index::{SemanticIndex, SemanticIndexStatus};
|
||||||
use settings::{Settings, SettingsStore};
|
use settings::Settings;
|
||||||
use std::{
|
use std::{
|
||||||
cell::Cell,
|
cell::Cell,
|
||||||
cmp,
|
cmp,
|
||||||
|
@ -165,7 +165,7 @@ impl AssistantPanel {
|
||||||
cx.on_focus_in(&focus_handle, Self::focus_in).detach();
|
cx.on_focus_in(&focus_handle, Self::focus_in).detach();
|
||||||
cx.on_focus_out(&focus_handle, Self::focus_out).detach();
|
cx.on_focus_out(&focus_handle, Self::focus_out).detach();
|
||||||
|
|
||||||
let mut this = Self {
|
Self {
|
||||||
workspace: workspace_handle,
|
workspace: workspace_handle,
|
||||||
active_editor_index: Default::default(),
|
active_editor_index: Default::default(),
|
||||||
prev_active_editor_index: Default::default(),
|
prev_active_editor_index: Default::default(),
|
||||||
|
@ -190,9 +190,7 @@ impl AssistantPanel {
|
||||||
_watch_saved_conversations,
|
_watch_saved_conversations,
|
||||||
semantic_index,
|
semantic_index,
|
||||||
retrieve_context_in_next_inline_assist: false,
|
retrieve_context_in_next_inline_assist: false,
|
||||||
};
|
}
|
||||||
|
|
||||||
this
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -3122,6 +3120,7 @@ mod tests {
|
||||||
use crate::MessageId;
|
use crate::MessageId;
|
||||||
use ai::test::FakeCompletionProvider;
|
use ai::test::FakeCompletionProvider;
|
||||||
use gpui::AppContext;
|
use gpui::AppContext;
|
||||||
|
use settings::SettingsStore;
|
||||||
|
|
||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
fn test_inserting_and_removing_messages(cx: &mut AppContext) {
|
fn test_inserting_and_removing_messages(cx: &mut AppContext) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::{collab_panel, is_channels_feature_enabled, ChatPanelSettings, CollabPanel};
|
use crate::{collab_panel, is_channels_feature_enabled, ChatPanelSettings};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use call::{room, ActiveCall};
|
use call::{room, ActiveCall};
|
||||||
use channel::{ChannelChat, ChannelChatEvent, ChannelMessageId, ChannelStore};
|
use channel::{ChannelChat, ChannelChatEvent, ChannelMessageId, ChannelStore};
|
||||||
|
@ -7,24 +7,22 @@ use collections::HashMap;
|
||||||
use db::kvp::KEY_VALUE_STORE;
|
use db::kvp::KEY_VALUE_STORE;
|
||||||
use editor::Editor;
|
use editor::Editor;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
actions, div, list, prelude::*, px, Action, AnyElement, AppContext, AsyncWindowContext,
|
actions, div, list, prelude::*, px, Action, AppContext, AsyncWindowContext, DismissEvent,
|
||||||
ClickEvent, DismissEvent, ElementId, EventEmitter, FocusHandle, FocusableView, FontWeight,
|
ElementId, EventEmitter, FocusHandle, FocusableView, FontWeight, ListOffset, ListScrollEvent,
|
||||||
ListOffset, ListScrollEvent, ListState, Model, Render, Subscription, Task, View, ViewContext,
|
ListState, Model, Render, Subscription, Task, View, ViewContext, VisualContext, WeakView,
|
||||||
VisualContext, WeakView,
|
|
||||||
};
|
};
|
||||||
use language::LanguageRegistry;
|
use language::LanguageRegistry;
|
||||||
use menu::Confirm;
|
use menu::Confirm;
|
||||||
use message_editor::MessageEditor;
|
use message_editor::MessageEditor;
|
||||||
use project::Fs;
|
use project::Fs;
|
||||||
use rich_text::RichText;
|
use rich_text::RichText;
|
||||||
use rpc::proto;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use settings::{Settings, SettingsStore};
|
use settings::Settings;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use time::{OffsetDateTime, UtcOffset};
|
use time::{OffsetDateTime, UtcOffset};
|
||||||
use ui::{
|
use ui::{
|
||||||
popover_menu, prelude::*, Avatar, Button, ContextMenu, IconButton, IconName, Key, KeyBinding,
|
popover_menu, prelude::*, Avatar, Button, ContextMenu, IconButton, IconName, KeyBinding, Label,
|
||||||
Label, TabBar, Tooltip,
|
TabBar,
|
||||||
};
|
};
|
||||||
use util::{ResultExt, TryFutureExt};
|
use util::{ResultExt, TryFutureExt};
|
||||||
use workspace::{
|
use workspace::{
|
||||||
|
@ -279,7 +277,7 @@ impl ChatPanel {
|
||||||
|
|
||||||
fn render_message(&mut self, ix: usize, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
fn render_message(&mut self, ix: usize, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
||||||
let active_chat = &self.active_chat.as_ref().unwrap().0;
|
let active_chat = &self.active_chat.as_ref().unwrap().0;
|
||||||
let (message, is_continuation_from_previous, is_continuation_to_next, is_admin) =
|
let (message, is_continuation_from_previous, is_admin) =
|
||||||
active_chat.update(cx, |active_chat, cx| {
|
active_chat.update(cx, |active_chat, cx| {
|
||||||
let is_admin = self
|
let is_admin = self
|
||||||
.channel_store
|
.channel_store
|
||||||
|
@ -288,13 +286,9 @@ impl ChatPanel {
|
||||||
|
|
||||||
let last_message = active_chat.message(ix.saturating_sub(1));
|
let last_message = active_chat.message(ix.saturating_sub(1));
|
||||||
let this_message = active_chat.message(ix).clone();
|
let this_message = active_chat.message(ix).clone();
|
||||||
let next_message =
|
|
||||||
active_chat.message(ix.saturating_add(1).min(active_chat.message_count() - 1));
|
|
||||||
|
|
||||||
let is_continuation_from_previous = last_message.id != this_message.id
|
let is_continuation_from_previous = last_message.id != this_message.id
|
||||||
&& last_message.sender.id == this_message.sender.id;
|
&& last_message.sender.id == this_message.sender.id;
|
||||||
let is_continuation_to_next = this_message.id != next_message.id
|
|
||||||
&& this_message.sender.id == next_message.sender.id;
|
|
||||||
|
|
||||||
if let ChannelMessageId::Saved(id) = this_message.id {
|
if let ChannelMessageId::Saved(id) = this_message.id {
|
||||||
if this_message
|
if this_message
|
||||||
|
@ -306,12 +300,7 @@ impl ChatPanel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(
|
(this_message, is_continuation_from_previous, is_admin)
|
||||||
this_message,
|
|
||||||
is_continuation_from_previous,
|
|
||||||
is_continuation_to_next,
|
|
||||||
is_admin,
|
|
||||||
)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let _is_pending = message.is_pending();
|
let _is_pending = message.is_pending();
|
||||||
|
|
|
@ -26,7 +26,7 @@ use menu::{Cancel, Confirm, SelectNext, SelectPrev};
|
||||||
use project::{Fs, Project};
|
use project::{Fs, Project};
|
||||||
use rpc::proto::{self, PeerId};
|
use rpc::proto::{self, PeerId};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
use settings::{Settings, SettingsStore};
|
use settings::Settings;
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use std::{mem, sync::Arc};
|
use std::{mem, sync::Arc};
|
||||||
use theme::{ActiveTheme, ThemeSettings};
|
use theme::{ActiveTheme, ThemeSettings};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
pub mod file_associations;
|
pub mod file_associations;
|
||||||
mod project_panel_settings;
|
mod project_panel_settings;
|
||||||
use settings::{Settings, SettingsStore};
|
use settings::Settings;
|
||||||
|
|
||||||
use db::kvp::KEY_VALUE_STORE;
|
use db::kvp::KEY_VALUE_STORE;
|
||||||
use editor::{scroll::autoscroll::Autoscroll, Cancel, Editor};
|
use editor::{scroll::autoscroll::Autoscroll, Cancel, Editor};
|
||||||
|
|
|
@ -11,7 +11,7 @@ use itertools::Itertools;
|
||||||
use project::{Fs, ProjectEntryId};
|
use project::{Fs, ProjectEntryId};
|
||||||
use search::{buffer_search::DivRegistrar, BufferSearchBar};
|
use search::{buffer_search::DivRegistrar, BufferSearchBar};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use settings::{Settings, SettingsStore};
|
use settings::Settings;
|
||||||
use terminal::terminal_settings::{TerminalDockPosition, TerminalSettings};
|
use terminal::terminal_settings::{TerminalDockPosition, TerminalSettings};
|
||||||
use ui::{h_stack, ButtonCommon, Clickable, IconButton, IconSize, Selectable, Tooltip};
|
use ui::{h_stack, ButtonCommon, Clickable, IconButton, IconSize, Selectable, Tooltip};
|
||||||
use util::{ResultExt, TryFutureExt};
|
use util::{ResultExt, TryFutureExt};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue