Skip to content

Commit

Permalink
assistant: Remove some re-exports (#23262)
Browse files Browse the repository at this point in the history
This PR removes some re-exports from the `assistant` to make it clearer
what its constituent modules depend on.

Release Notes:

- N/A
  • Loading branch information
maxdeviant authored Jan 16, 2025
1 parent 8030c00 commit 4d22f7e
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 20 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 10 additions & 11 deletions crates/assistant/src/assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,34 @@ pub mod slash_command_settings;
mod streaming_diff;
mod terminal_inline_assistant;

pub use ::prompt_library::PromptBuilder;
use ::prompt_library::PromptLoadingParams;
pub use assistant_panel::{AssistantPanel, AssistantPanelEvent};
use std::path::PathBuf;
use std::sync::Arc;

use ::prompt_library::{PromptBuilder, PromptLoadingParams};
use assistant_settings::AssistantSettings;
use assistant_slash_command::SlashCommandRegistry;
pub use assistant_slash_command::{SlashCommandId, SlashCommandWorkingSet};
use assistant_slash_commands::{ProjectSlashCommandFeatureFlag, SearchSlashCommandFeatureFlag};
use client::{proto, Client};
use command_palette_hooks::CommandPaletteFilter;
pub use context::*;
pub use context_store::*;
use feature_flags::FeatureFlagAppExt;
use fs::Fs;
use gpui::impl_internal_actions;
use gpui::{actions, AppContext, Global, SharedString, UpdateGlobal};
pub(crate) use inline_assistant::*;
use language_model::{
LanguageModelId, LanguageModelProviderId, LanguageModelRegistry, LanguageModelResponseMessage,
};
pub use patch::*;
use semantic_index::{CloudEmbeddingProvider, SemanticDb};
use serde::{Deserialize, Serialize};
use settings::{Settings, SettingsStore};
use std::path::PathBuf;
use std::sync::Arc;
pub(crate) use streaming_diff::*;
use util::ResultExt;

pub use crate::assistant_panel::{AssistantPanel, AssistantPanelEvent};
pub use crate::context::*;
pub use crate::context_store::*;
pub(crate) use crate::inline_assistant::*;
pub use crate::patch::*;
use crate::slash_command_settings::SlashCommandSettings;
pub(crate) use crate::streaming_diff::*;

actions!(
assistant,
Expand Down
3 changes: 2 additions & 1 deletion crates/assistant/src/context/context_tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::{AssistantEdit, MessageCacheMetadata};
use crate::{
assistant_panel, AssistantEditKind, CacheStatus, Context, ContextEvent, ContextId,
ContextOperation, InvokedSlashCommandId, MessageId, MessageStatus, PromptBuilder,
ContextOperation, InvokedSlashCommandId, MessageId, MessageStatus,
};
use anyhow::Result;
use assistant_slash_command::{
Expand All @@ -22,6 +22,7 @@ use language_model::{LanguageModelCacheConfiguration, LanguageModelRegistry, Rol
use parking_lot::Mutex;
use pretty_assertions::assert_eq;
use project::Project;
use prompt_library::PromptBuilder;
use rand::prelude::*;
use serde_json::json;
use settings::SettingsStore;
Expand Down
3 changes: 1 addition & 2 deletions crates/assistant/src/context_store.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use crate::SlashCommandId;
use crate::{
Context, ContextEvent, ContextId, ContextOperation, ContextVersion, SavedContext,
SavedContextMetadata,
};
use anyhow::{anyhow, Context as _, Result};
use assistant_slash_command::SlashCommandWorkingSet;
use assistant_slash_command::{SlashCommandId, SlashCommandWorkingSet};
use assistant_tool::{ToolId, ToolWorkingSet};
use client::{proto, telemetry::Telemetry, Client, TypedEnvelope};
use clock::ReplicaId;
Expand Down
2 changes: 1 addition & 1 deletion crates/assistant/src/prompt_library.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::SlashCommandWorkingSet;
use crate::{slash_command::SlashCommandCompletionProvider, AssistantPanel, InlineAssistant};
use anyhow::Result;
use assistant_slash_command::SlashCommandWorkingSet;
use collections::{HashMap, HashSet};
use editor::{actions::Tab, CurrentLineHighlight, Editor, EditorElement, EditorEvent, EditorStyle};
use gpui::{
Expand Down
2 changes: 1 addition & 1 deletion crates/assistant/src/slash_command.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::assistant_panel::ContextEditor;
use crate::SlashCommandWorkingSet;
use anyhow::Result;
use assistant_slash_command::AfterCompletion;
pub use assistant_slash_command::SlashCommand;
use assistant_slash_command::SlashCommandWorkingSet;
use editor::{CompletionProvider, Editor};
use fuzzy::{match_strings, StringMatchCandidate};
use gpui::{Model, Task, ViewContext, WeakView, WindowContext};
Expand Down
2 changes: 1 addition & 1 deletion crates/assistant/src/slash_command_picker.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::sync::Arc;

use assistant_slash_command::SlashCommandWorkingSet;
use gpui::{AnyElement, DismissEvent, SharedString, Task, WeakView};
use picker::{Picker, PickerDelegate, PickerEditorPosition};
use ui::{prelude::*, ListItem, ListItemSpacing, PopoverMenu, PopoverTrigger, Tooltip};

use crate::assistant_panel::ContextEditor;
use crate::SlashCommandWorkingSet;

#[derive(IntoElement)]
pub(super) struct SlashCommandSelector<T: PopoverTrigger> {
Expand Down
4 changes: 3 additions & 1 deletion crates/collab/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,16 @@ uuid.workspace = true

[dev-dependencies]
assistant = { workspace = true, features = ["test-support"] }
assistant_slash_command.workspace = true
assistant_tool.workspace = true
context_server.workspace = true
async-trait.workspace = true
audio.workspace = true
call = { workspace = true, features = ["test-support"] }
channel.workspace = true
client = { workspace = true, features = ["test-support"] }
collab_ui = { workspace = true, features = ["test-support"] }
collections = { workspace = true, features = ["test-support"] }
context_server.workspace = true
ctor.workspace = true
editor = { workspace = true, features = ["test-support"] }
env_logger.workspace = true
Expand All @@ -108,6 +109,7 @@ node_runtime.workspace = true
notifications = { workspace = true, features = ["test-support"] }
pretty_assertions.workspace = true
project = { workspace = true, features = ["test-support"] }
prompt_library.workspace = true
recent_projects = { workspace = true }
release_channel.workspace = true
remote = { workspace = true, features = ["test-support"] }
Expand Down
4 changes: 3 additions & 1 deletion crates/collab/src/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ use crate::{
},
};
use anyhow::{anyhow, Result};
use assistant::{ContextStore, PromptBuilder, SlashCommandWorkingSet};
use assistant::ContextStore;
use assistant_slash_command::SlashCommandWorkingSet;
use assistant_tool::ToolWorkingSet;
use call::{room, ActiveCall, ParticipantLocation, Room};
use client::{User, RECEIVE_TIMEOUT};
use collections::{HashMap, HashSet};
use fs::{FakeFs, Fs as _, RemoveOptions};
use futures::{channel::mpsc, StreamExt as _};
use prompt_library::PromptBuilder;

use git::status::{FileStatus, StatusCode, TrackedStatus, UnmergedStatus, UnmergedStatusCode};
use gpui::{
Expand Down
1 change: 1 addition & 0 deletions crates/zed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ profiling.workspace = true
project.workspace = true
project_panel.workspace = true
project_symbols.workspace = true
prompt_library.workspace = true
proto.workspace = true
recent_projects.workspace = true
release_channel.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/zed/src/zed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pub(crate) mod windows_only_instance;
use anyhow::Context as _;
pub use app_menus::*;
use assets::Assets;
use assistant::PromptBuilder;
use breadcrumbs::Breadcrumbs;
use client::{zed_urls, ZED_URL_SCHEME};
use collections::VecDeque;
Expand All @@ -32,6 +31,7 @@ use outline_panel::OutlinePanel;
use paths::{local_settings_file_relative_path, local_tasks_file_relative_path};
use project::{DirectoryLister, ProjectItem};
use project_panel::ProjectPanel;
use prompt_library::PromptBuilder;
use quick_action_bar::QuickActionBar;
use recent_projects::open_ssh_project;
use release_channel::{AppCommitSha, ReleaseChannel};
Expand Down

0 comments on commit 4d22f7e

Please sign in to comment.