From 258a8a37d8a261084953e43bd5cba98875258b09 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 17 Jun 2024 19:27:42 -0400 Subject: [PATCH] Extract paths out of `util` (#13182) This PR extracts the definition of the various Zed paths out of `util` and into a new `paths` crate. `util` is for generic utils, while these paths are Zed-specific. For instance, `gpui` depends on `util`, and it shouldn't have knowledge of these paths, since they are only used by Zed. Release Notes: - N/A --- Cargo.lock | 37 +++++--- Cargo.toml | 5 +- crates/assistant/Cargo.toml | 1 + crates/assistant/src/assistant.rs | 2 +- crates/assistant/src/assistant_panel.rs | 3 +- crates/assistant/src/context_store.rs | 3 +- crates/assistant/src/prompt_library.rs | 3 +- crates/cli/Cargo.toml | 1 + crates/cli/src/main.rs | 1 - crates/client/Cargo.toml | 1 + crates/client/src/client.rs | 2 +- crates/client/src/telemetry.rs | 2 +- crates/copilot/Cargo.toml | 1 + crates/copilot/src/copilot.rs | 2 +- crates/db/Cargo.toml | 1 + crates/db/src/db.rs | 2 +- crates/extension/Cargo.toml | 1 + crates/extension/src/extension_store.rs | 3 +- crates/fs/Cargo.toml | 24 +++-- crates/fs/src/fs.rs | 2 +- crates/inline_completion_button/Cargo.toml | 1 + .../src/inline_completion_button.rs | 2 +- crates/languages/Cargo.toml | 1 + crates/languages/src/json.rs | 2 +- crates/node_runtime/Cargo.toml | 1 + crates/node_runtime/src/node_runtime.rs | 2 +- crates/paths/Cargo.toml | 17 ++++ crates/paths/LICENSE-GPL | 1 + crates/paths/src/paths.rs | 92 +++++++++++++++++++ crates/prettier/Cargo.toml | 1 + crates/prettier/src/prettier.rs | 3 +- crates/project/Cargo.toml | 1 + crates/project/src/prettier_support.rs | 3 +- crates/project/src/project.rs | 10 +- crates/rustdoc/Cargo.toml | 1 + crates/rustdoc/src/store.rs | 2 +- crates/settings/Cargo.toml | 1 + crates/settings/src/settings_file.rs | 2 +- crates/supermaven_api/Cargo.toml | 2 +- crates/supermaven_api/src/supermaven_api.rs | 2 +- crates/terminal/Cargo.toml | 2 +- crates/terminal_view/Cargo.toml | 2 +- crates/util/Cargo.toml | 2 +- crates/util/src/paths.rs | 84 ----------------- crates/zed/Cargo.toml | 1 + crates/zed/src/main.rs | 14 +-- crates/zed/src/reliability.rs | 2 +- crates/zed/src/zed.rs | 7 +- crates/zed/src/zed/open_listener.rs | 1 - 49 files changed, 208 insertions(+), 151 deletions(-) create mode 100644 crates/paths/Cargo.toml create mode 120000 crates/paths/LICENSE-GPL create mode 100644 crates/paths/src/paths.rs diff --git a/Cargo.lock b/Cargo.lock index 671305067603461d8637418024397aaa0496d8bd..d41dcdd73d841fc98c40e13c0f12d5fec798faac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -387,6 +387,7 @@ dependencies = [ "open_ai", "ordered-float 2.10.0", "parking_lot", + "paths", "picker", "project", "rand 0.8.5", @@ -2210,6 +2211,7 @@ dependencies = [ "fork", "ipc-channel", "once_cell", + "paths", "plist", "release_channel", "serde", @@ -2280,6 +2282,7 @@ dependencies = [ "log", "once_cell", "parking_lot", + "paths", "postage", "rand 0.8.5", "release_channel", @@ -2669,6 +2672,7 @@ dependencies = [ "menu", "node_runtime", "parking_lot", + "paths", "project", "rpc", "serde", @@ -3223,6 +3227,7 @@ dependencies = [ "indoc", "lazy_static", "log", + "paths", "release_channel", "smol", "sqlez", @@ -3393,15 +3398,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "dirs" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" -dependencies = [ - "dirs-sys 0.3.7", -] - [[package]] name = "dirs" version = "4.0.0" @@ -3856,6 +3852,7 @@ dependencies = [ "lsp", "node_runtime", "parking_lot", + "paths", "project", "release_channel", "schemars", @@ -4312,6 +4309,7 @@ dependencies = [ "notify", "objc", "parking_lot", + "paths", "rope", "serde", "serde_json", @@ -5445,6 +5443,7 @@ dependencies = [ "indoc", "language", "lsp", + "paths", "project", "serde_json", "settings", @@ -5898,6 +5897,7 @@ dependencies = [ "log", "lsp", "node_runtime", + "paths", "project", "regex", "rope", @@ -6667,6 +6667,7 @@ dependencies = [ "futures 0.3.28", "http 0.1.0", "log", + "paths", "semver", "serde", "serde_json", @@ -7402,6 +7403,15 @@ dependencies = [ "rustc_version", ] +[[package]] +name = "paths" +version = "0.1.0" +dependencies = [ + "dirs 4.0.0", + "lazy_static", + "util", +] + [[package]] name = "pbkdf2" version = "0.8.0" @@ -7797,6 +7807,7 @@ dependencies = [ "lsp", "node_runtime", "parking_lot", + "paths", "serde", "serde_json", "util", @@ -7929,6 +7940,7 @@ dependencies = [ "node_runtime", "parking_lot", "pathdiff", + "paths", "postage", "prettier", "pretty_assertions", @@ -8871,6 +8883,7 @@ dependencies = [ "indexmap 1.9.3", "indoc", "parking_lot", + "paths", "pretty_assertions", "serde", "strum", @@ -9431,6 +9444,7 @@ dependencies = [ "gpui", "indoc", "lazy_static", + "paths", "pretty_assertions", "release_channel", "rust-embed", @@ -10266,10 +10280,10 @@ dependencies = [ "anyhow", "futures 0.3.28", "http 0.1.0", + "paths", "serde", "serde_json", "smol", - "util", ] [[package]] @@ -11709,7 +11723,7 @@ dependencies = [ "anyhow", "async-fs 1.6.0", "collections", - "dirs 3.0.2", + "dirs 4.0.0", "futures 0.3.28", "futures-lite 1.13.0", "git2", @@ -13480,6 +13494,7 @@ dependencies = [ "outline", "outline_panel", "parking_lot", + "paths", "profiling", "project", "project_panel", diff --git a/Cargo.toml b/Cargo.toml index 79e90509cfa2b000c41c101047b74d839d617506..8829c1fd71257f77fd368b52ccbef960ccc9d90e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,6 +65,7 @@ members = [ "crates/open_ai", "crates/outline", "crates/outline_panel", + "crates/paths", "crates/picker", "crates/prettier", "crates/project", @@ -215,6 +216,7 @@ ollama = { path = "crates/ollama" } open_ai = { path = "crates/open_ai" } outline = { path = "crates/outline" } outline_panel = { path = "crates/outline_panel" } +paths = { path = "crates/paths" } picker = { path = "crates/picker" } plugin = { path = "crates/plugin" } plugin_macros = { path = "crates/plugin_macros" } @@ -288,10 +290,10 @@ clap = { version = "4.4", features = ["derive"] } clickhouse = { version = "0.11.6" } cocoa = "0.25" ctor = "0.2.6" -signal-hook = "0.3.17" core-foundation = { version = "0.9.3" } core-foundation-sys = "0.8.6" derive_more = "0.99.17" +dirs = "4.0" emojis = "0.6.1" env_logger = "0.9" exec = "0.3.1" @@ -354,6 +356,7 @@ serde_repr = "0.1" sha2 = "0.10" shellexpand = "2.1.0" shlex = "1.3.0" +signal-hook = "0.3.17" similar = "1.3" smallvec = { version = "1.6", features = ["union"] } smol = "1.2" diff --git a/crates/assistant/Cargo.toml b/crates/assistant/Cargo.toml index 3dbd08bdbc74942bd1735746cfaebf27eec0bd14..44a2e65b2fa5ef064f7840a4a7d7e561a3598b69 100644 --- a/crates/assistant/Cargo.toml +++ b/crates/assistant/Cargo.toml @@ -39,6 +39,7 @@ ollama = { workspace = true, features = ["schemars"] } open_ai = { workspace = true, features = ["schemars"] } ordered-float.workspace = true parking_lot.workspace = true +paths.workspace = true project.workspace = true regex.workspace = true rope.workspace = true diff --git a/crates/assistant/src/assistant.rs b/crates/assistant/src/assistant.rs index 15bc7b330d249a2f891d920122306b2ee8ea4230..543e03421d82c128708f10e87274848b743cf672 100644 --- a/crates/assistant/src/assistant.rs +++ b/crates/assistant/src/assistant.rs @@ -21,6 +21,7 @@ pub(crate) use context_store::*; use gpui::{actions, AppContext, Global, SharedString, UpdateGlobal}; pub(crate) use inline_assistant::*; pub(crate) use model_selector::*; +use paths::EMBEDDINGS_DIR; use rustdoc::RustdocStore; use semantic_index::{CloudEmbeddingProvider, SemanticIndex}; use serde::{Deserialize, Serialize}; @@ -34,7 +35,6 @@ use std::{ sync::Arc, }; pub(crate) use streaming_diff::*; -use util::paths::EMBEDDINGS_DIR; actions!( assistant, diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index da4efbfbd723daf8696b45294c726fd69e6d7079..e642e090d572c1f52e2318f855e5680c61d9fc09 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -40,6 +40,7 @@ use language::{ LspAdapterDelegate, OffsetRangeExt as _, Point, ToOffset as _, }; use multi_buffer::MultiBufferRow; +use paths::CONTEXTS_DIR; use picker::{Picker, PickerDelegate}; use project::{Project, ProjectLspAdapterDelegate, ProjectTransaction}; use rustdoc::{CrateName, RustdocStore}; @@ -59,7 +60,7 @@ use ui::{ prelude::*, ButtonLike, ContextMenu, Disclosure, ElevationIndex, KeyBinding, ListItem, ListItemSpacing, PopoverMenu, PopoverMenuHandle, Tab, TabBar, Tooltip, }; -use util::{paths::CONTEXTS_DIR, post_inc, ResultExt, TryFutureExt}; +use util::{post_inc, ResultExt, TryFutureExt}; use uuid::Uuid; use workspace::NewFile; use workspace::{ diff --git a/crates/assistant/src/context_store.rs b/crates/assistant/src/context_store.rs index 7eb366709f41ae01e135eb77ce6f364f27f4962a..d216ba0999fc0f1035580f0b1effdb901bc39122 100644 --- a/crates/assistant/src/context_store.rs +++ b/crates/assistant/src/context_store.rs @@ -5,11 +5,12 @@ use fs::Fs; use futures::StreamExt; use fuzzy::StringMatchCandidate; use gpui::{AppContext, Model, ModelContext, Task}; +use paths::CONTEXTS_DIR; use regex::Regex; use serde::{Deserialize, Serialize}; use std::{cmp::Reverse, ffi::OsStr, path::PathBuf, sync::Arc, time::Duration}; use ui::Context; -use util::{paths::CONTEXTS_DIR, ResultExt, TryFutureExt}; +use util::{ResultExt, TryFutureExt}; #[derive(Serialize, Deserialize)] pub struct SavedMessage { diff --git a/crates/assistant/src/prompt_library.rs b/crates/assistant/src/prompt_library.rs index 6e041d3b7057a37c120b14b35ba51ff759ca5685..fa693d77e8be504dcc68adafb28483443c8c8c29 100644 --- a/crates/assistant/src/prompt_library.rs +++ b/crates/assistant/src/prompt_library.rs @@ -20,6 +20,7 @@ use gpui::{ use heed::{types::SerdeBincode, Database, RoTxn}; use language::{language_settings::SoftWrap, Buffer, LanguageRegistry}; use parking_lot::RwLock; +use paths::PROMPTS_DIR; use picker::{Picker, PickerDelegate}; use rope::Rope; use serde::{Deserialize, Serialize}; @@ -36,7 +37,7 @@ use ui::{ div, prelude::*, IconButtonShape, ListItem, ListItemSpacing, ParentElement, Render, SharedString, Styled, TitleBar, Tooltip, ViewContext, VisualContext, }; -use util::{paths::PROMPTS_DIR, ResultExt, TryFutureExt}; +use util::{ResultExt, TryFutureExt}; use uuid::Uuid; use workspace::Workspace; diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 7c82fce37e3cfaf0c27ca6ea2e06e02c4f82acbb..ae58f7c641bf9c873bb173c20024082f6db15599 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -21,6 +21,7 @@ anyhow.workspace = true clap.workspace = true ipc-channel = "0.18" once_cell.workspace = true +paths.workspace = true release_channel.workspace = true serde.workspace = true util.workspace = true diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 28a84b8faab31551452255bc0ac81e97da485b90..52fb700ad2bd7dc431dd5b6cd080fc438d96048e 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -172,7 +172,6 @@ mod linux { use cli::FORCE_CLI_MODE_ENV_VAR_NAME; use fork::Fork; use once_cell::sync::Lazy; - use util::paths; use crate::{Detect, InstalledApp}; diff --git a/crates/client/Cargo.toml b/crates/client/Cargo.toml index 9ccf01cb7bc440aad766b447cf39865ce710a3f7..ae44d7cd30f486eaa9fd7484e07c65aa0dc3e46b 100644 --- a/crates/client/Cargo.toml +++ b/crates/client/Cargo.toml @@ -31,6 +31,7 @@ http.workspace = true lazy_static.workspace = true log.workspace = true once_cell.workspace = true +paths.workspace = true parking_lot.workspace = true postage.workspace = true rand.workspace = true diff --git a/crates/client/src/client.rs b/crates/client/src/client.rs index dc30080f8bebc39a309f9a0451df6a9c50943617..71653bc9142a40b22c21d79febf726ac04d3c850 100644 --- a/crates/client/src/client.rs +++ b/crates/client/src/client.rs @@ -509,7 +509,7 @@ impl Client { let credentials_provider: Arc = if use_zed_development_auth { Arc::new(DevelopmentCredentialsProvider { - path: util::paths::CONFIG_DIR.join("development_auth"), + path: paths::CONFIG_DIR.join("development_auth"), }) } else { Arc::new(KeychainCredentialsProvider) diff --git a/crates/client/src/telemetry.rs b/crates/client/src/telemetry.rs index 195954937f83a0bbcc290323572080a287d03dc9..ae230a8a0294de3bd115f2d2fa964d73dee8d500 100644 --- a/crates/client/src/telemetry.rs +++ b/crates/client/src/telemetry.rs @@ -223,7 +223,7 @@ impl Telemetry { let state = state.clone(); async move { if let Some(tempfile) = - NamedTempFile::new_in(util::paths::CONFIG_DIR.as_path()).log_err() + NamedTempFile::new_in(paths::CONFIG_DIR.as_path()).log_err() { state.lock().log_file = Some(tempfile); } diff --git a/crates/copilot/Cargo.toml b/crates/copilot/Cargo.toml index f7b9988e48df3e81979dc6b5abfe1e68b6e56a8f..70915ecab27187ccb68d15610b4da178bf632078 100644 --- a/crates/copilot/Cargo.toml +++ b/crates/copilot/Cargo.toml @@ -38,6 +38,7 @@ lsp.workspace = true menu.workspace = true node_runtime.workspace = true parking_lot.workspace = true +paths.workspace = true project.workspace = true serde.workspace = true settings.workspace = true diff --git a/crates/copilot/src/copilot.rs b/crates/copilot/src/copilot.rs index b1047a18fdf90b3a0022c6aea0d39f07bcb9b1fc..7ce0d2176c7d7c25f5f3cc7eb600ead8b4d1f667 100644 --- a/crates/copilot/src/copilot.rs +++ b/crates/copilot/src/copilot.rs @@ -33,7 +33,7 @@ use std::{ path::{Path, PathBuf}, sync::Arc, }; -use util::{fs::remove_matching, maybe, paths, ResultExt}; +use util::{fs::remove_matching, maybe, ResultExt}; pub use copilot_completion_provider::CopilotCompletionProvider; pub use sign_in::CopilotCodeVerification; diff --git a/crates/db/Cargo.toml b/crates/db/Cargo.toml index f31609277db13282c9f2a67dfbf414dc92578c80..f36785ea1e5925d8b5620951447d2779535c6e43 100644 --- a/crates/db/Cargo.toml +++ b/crates/db/Cargo.toml @@ -21,6 +21,7 @@ gpui.workspace = true indoc.workspace = true lazy_static.workspace = true log.workspace = true +paths.workspace = true release_channel.workspace = true smol.workspace = true sqlez.workspace = true diff --git a/crates/db/src/db.rs b/crates/db/src/db.rs index 577a1746d51d8e674b00837acda74e86597281c7..56aaba245ac8e14e81333c0347c886e3e0277175 100644 --- a/crates/db/src/db.rs +++ b/crates/db/src/db.rs @@ -7,10 +7,10 @@ use anyhow::Context; use gpui::AppContext; pub use indoc::indoc; pub use lazy_static; +pub use paths::DB_DIR; pub use smol; pub use sqlez; pub use sqlez_macros; -pub use util::paths::DB_DIR; use release_channel::ReleaseChannel; pub use release_channel::RELEASE_CHANNEL; diff --git a/crates/extension/Cargo.toml b/crates/extension/Cargo.toml index 53ff78b68c66a4fc6cd9361214a83531dfc94580..1a7e3242cb49c591f83bcc261fc785381c7cb297 100644 --- a/crates/extension/Cargo.toml +++ b/crates/extension/Cargo.toml @@ -33,6 +33,7 @@ language.workspace = true log.workspace = true lsp.workspace = true node_runtime.workspace = true +paths.workspace = true project.workspace = true release_channel.workspace = true schemars.workspace = true diff --git a/crates/extension/src/extension_store.rs b/crates/extension/src/extension_store.rs index a4aa6bfafd848b53e966ee904e6abf10b0ee3de8..894aeee9fa3c30ac6a3765a407310bf0453980bc 100644 --- a/crates/extension/src/extension_store.rs +++ b/crates/extension/src/extension_store.rs @@ -36,6 +36,7 @@ use language::{ LanguageConfig, LanguageMatcher, LanguageQueries, LanguageRegistry, QUERY_FILENAME_PREFIXES, }; use node_runtime::NodeRuntime; +use paths::EXTENSIONS_DIR; use project::ContextProviderWithTasks; use release_channel::ReleaseChannel; use semantic_version::SemanticVersion; @@ -51,7 +52,7 @@ use std::{ }; use theme::{ThemeRegistry, ThemeSettings}; use url::Url; -use util::{maybe, paths::EXTENSIONS_DIR, ResultExt}; +use util::{maybe, ResultExt}; use wasm_host::{ wit::{is_supported_wasm_api_version, wasm_api_version_range}, WasmExtension, WasmHost, diff --git a/crates/fs/Cargo.toml b/crates/fs/Cargo.toml index b294eb132e301480ad242718fd04497cd99f77c6..98ce46571141c6f7fce82f5038954458c5166da4 100644 --- a/crates/fs/Cargo.toml +++ b/crates/fs/Cargo.toml @@ -12,34 +12,32 @@ workspace = true path = "src/fs.rs" [dependencies] -collections.workspace = true -rope.workspace = true -text.workspace = true -util.workspace = true - anyhow.workspace = true async-tar.workspace = true async-trait.workspace = true +collections.workspace = true futures.workspace = true -tempfile.workspace = true -lazy_static.workspace = true -parking_lot.workspace = true -smol.workspace = true git.workspace = true git2.workspace = true +gpui = { workspace = true, optional = true } +lazy_static.workspace = true +libc.workspace = true +parking_lot.workspace = true +paths.workspace = true +rope.workspace = true serde.workspace = true serde_json.workspace = true -libc.workspace = true +smol.workspace = true +tempfile.workspace = true +text.workspace = true time.workspace = true - -gpui = { workspace = true, optional = true } +util.workspace = true [target.'cfg(target_os = "macos")'.dependencies] fsevent.workspace = true objc = "0.2" cocoa = "0.25" - [target.'cfg(not(target_os = "macos"))'.dependencies] notify = "6.1.1" diff --git a/crates/fs/src/fs.rs b/crates/fs/src/fs.rs index 7b76c4327ccc889d93a4112588c64e0c73ff65b8..6a5f97c94d35c660c5676c73744969f60a93cc5d 100644 --- a/crates/fs/src/fs.rs +++ b/crates/fs/src/fs.rs @@ -23,7 +23,7 @@ use std::{ }; use tempfile::{NamedTempFile, TempDir}; use text::LineEnding; -use util::{paths, ResultExt}; +use util::ResultExt; #[cfg(any(test, feature = "test-support"))] use collections::{btree_map, BTreeMap}; diff --git a/crates/inline_completion_button/Cargo.toml b/crates/inline_completion_button/Cargo.toml index 48acdb3ae1d89ae47314c66ba6a3719293ab0e85..13b2bfa2eab20e7d4e6418c79bc02dcb4fcb470f 100644 --- a/crates/inline_completion_button/Cargo.toml +++ b/crates/inline_completion_button/Cargo.toml @@ -19,6 +19,7 @@ editor.workspace = true fs.workspace = true gpui.workspace = true language.workspace = true +paths.workspace = true settings.workspace = true supermaven.workspace = true ui.workspace = true diff --git a/crates/inline_completion_button/src/inline_completion_button.rs b/crates/inline_completion_button/src/inline_completion_button.rs index bc6086aac9f307e761b8d57e7b5404570431ae51..0ecabb33cb735a9c61dd775f968058df7e0d1114 100644 --- a/crates/inline_completion_button/src/inline_completion_button.rs +++ b/crates/inline_completion_button/src/inline_completion_button.rs @@ -15,7 +15,7 @@ use language::{ use settings::{update_settings_file, Settings, SettingsStore}; use std::{path::Path, sync::Arc}; use supermaven::{AccountStatus, Supermaven}; -use util::{paths, ResultExt}; +use util::ResultExt; use workspace::{ create_and_open_local_file, item::ItemHandle, diff --git a/crates/languages/Cargo.toml b/crates/languages/Cargo.toml index 96df7ef410faef1ec04740c69e16b79ddcbed0b8..3562c17a0826519e50a3fff9f3a6a4e517b9bc49 100644 --- a/crates/languages/Cargo.toml +++ b/crates/languages/Cargo.toml @@ -26,6 +26,7 @@ lazy_static.workspace = true log.workspace = true lsp.workspace = true node_runtime.workspace = true +paths.workspace = true project.workspace = true regex.workspace = true rope.workspace = true diff --git a/crates/languages/src/json.rs b/crates/languages/src/json.rs index d00452adc515bd6c0390e0863dea6ae38d4f4e38..658d3b1a21d244390a790d4478e726b76b0302e9 100644 --- a/crates/languages/src/json.rs +++ b/crates/languages/src/json.rs @@ -19,7 +19,7 @@ use std::{ sync::{Arc, OnceLock}, }; use task::{TaskTemplate, TaskTemplates, VariableName}; -use util::{maybe, paths, ResultExt}; +use util::{maybe, ResultExt}; const SERVER_PATH: &str = "node_modules/vscode-json-languageserver/bin/vscode-json-languageserver"; diff --git a/crates/node_runtime/Cargo.toml b/crates/node_runtime/Cargo.toml index a87d9d92e58d1f168ad1a04cab6c91109de434a0..aee792f0186ad2ea6fb4179bfd023fb198680088 100644 --- a/crates/node_runtime/Cargo.toml +++ b/crates/node_runtime/Cargo.toml @@ -24,6 +24,7 @@ async_zip.workspace = true futures.workspace = true http.workspace = true log.workspace = true +paths.workspace = true semver.workspace = true serde.workspace = true serde_json.workspace = true diff --git a/crates/node_runtime/src/node_runtime.rs b/crates/node_runtime/src/node_runtime.rs index a00ce6cd23682541687f68d1d626921eeb9ae7cf..766c8237d1d30a5dabe1d36cc66c6535e5503a82 100644 --- a/crates/node_runtime/src/node_runtime.rs +++ b/crates/node_runtime/src/node_runtime.rs @@ -138,7 +138,7 @@ impl RealNodeRuntime { }; let folder_name = format!("node-{VERSION}-{os}-{arch}"); - let node_containing_dir = util::paths::SUPPORT_DIR.join("node"); + let node_containing_dir = paths::SUPPORT_DIR.join("node"); let node_dir = node_containing_dir.join(folder_name); let node_binary = node_dir.join(NODE_PATH); let npm_file = node_dir.join(NPM_PATH); diff --git a/crates/paths/Cargo.toml b/crates/paths/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..5947721bd1c25375d150e8cdc4554b4ecba1d4c0 --- /dev/null +++ b/crates/paths/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "paths" +version = "0.1.0" +edition = "2021" +publish = false +license = "GPL-3.0-or-later" + +[lints] +workspace = true + +[lib] +path = "src/paths.rs" + +[dependencies] +dirs.workspace = true +lazy_static.workspace = true +util.workspace = true diff --git a/crates/paths/LICENSE-GPL b/crates/paths/LICENSE-GPL new file mode 120000 index 0000000000000000000000000000000000000000..89e542f750cd3860a0598eff0dc34b56d7336dc4 --- /dev/null +++ b/crates/paths/LICENSE-GPL @@ -0,0 +1 @@ +../../LICENSE-GPL \ No newline at end of file diff --git a/crates/paths/src/paths.rs b/crates/paths/src/paths.rs new file mode 100644 index 0000000000000000000000000000000000000000..558709651fc92f94c6a2f320f3da4376207aa489 --- /dev/null +++ b/crates/paths/src/paths.rs @@ -0,0 +1,92 @@ +//! Paths to locations used by Zed. + +use std::path::{Path, PathBuf}; + +use util::paths::HOME; + +lazy_static::lazy_static! { + pub static ref CONFIG_DIR: PathBuf = if cfg!(target_os = "windows") { + dirs::config_dir() + .expect("failed to determine RoamingAppData directory") + .join("Zed") + } else if cfg!(target_os = "linux") { + if let Ok(flatpak_xdg_config) = std::env::var("FLATPAK_XDG_CONFIG_HOME") { + flatpak_xdg_config.into() + } else { + dirs::config_dir().expect("failed to determine XDG_CONFIG_HOME directory") + }.join("zed") + } else { + HOME.join(".config").join("zed") + }; + pub static ref CONTEXTS_DIR: PathBuf = if cfg!(target_os = "macos") { + CONFIG_DIR.join("conversations") + } else { + SUPPORT_DIR.join("conversations") + }; + pub static ref PROMPTS_DIR: PathBuf = if cfg!(target_os = "macos") { + CONFIG_DIR.join("prompts") + } else { + SUPPORT_DIR.join("prompts") + }; + pub static ref EMBEDDINGS_DIR: PathBuf = if cfg!(target_os = "macos") { + CONFIG_DIR.join("embeddings") + } else { + SUPPORT_DIR.join("embeddings") + }; + pub static ref THEMES_DIR: PathBuf = CONFIG_DIR.join("themes"); + + pub static ref SUPPORT_DIR: PathBuf = if cfg!(target_os = "macos") { + HOME.join("Library/Application Support/Zed") + } else if cfg!(target_os = "linux") { + if let Ok(flatpak_xdg_data) = std::env::var("FLATPAK_XDG_DATA_HOME") { + flatpak_xdg_data.into() + } else { + dirs::data_local_dir().expect("failed to determine XDG_DATA_HOME directory") + }.join("zed") + } else if cfg!(target_os = "windows") { + dirs::data_local_dir() + .expect("failed to determine LocalAppData directory") + .join("Zed") + } else { + CONFIG_DIR.clone() + }; + pub static ref LOGS_DIR: PathBuf = if cfg!(target_os = "macos") { + HOME.join("Library/Logs/Zed") + } else { + SUPPORT_DIR.join("logs") + }; + pub static ref EXTENSIONS_DIR: PathBuf = SUPPORT_DIR.join("extensions"); + pub static ref LANGUAGES_DIR: PathBuf = SUPPORT_DIR.join("languages"); + pub static ref COPILOT_DIR: PathBuf = SUPPORT_DIR.join("copilot"); + pub static ref SUPERMAVEN_DIR: PathBuf = SUPPORT_DIR.join("supermaven"); + pub static ref DEFAULT_PRETTIER_DIR: PathBuf = SUPPORT_DIR.join("prettier"); + pub static ref DB_DIR: PathBuf = SUPPORT_DIR.join("db"); + pub static ref CRASHES_DIR: Option = cfg!(target_os = "macos") + .then_some(HOME.join("Library/Logs/DiagnosticReports")); + pub static ref CRASHES_RETIRED_DIR: Option = CRASHES_DIR + .as_ref() + .map(|dir| dir.join("Retired")); + + pub static ref SETTINGS: PathBuf = CONFIG_DIR.join("settings.json"); + pub static ref KEYMAP: PathBuf = CONFIG_DIR.join("keymap.json"); + pub static ref TASKS: PathBuf = CONFIG_DIR.join("tasks.json"); + pub static ref LAST_USERNAME: PathBuf = CONFIG_DIR.join("last-username.txt"); + pub static ref LOG: PathBuf = LOGS_DIR.join("Zed.log"); + pub static ref OLD_LOG: PathBuf = LOGS_DIR.join("Zed.log.old"); + pub static ref LOCAL_SETTINGS_RELATIVE_PATH: &'static Path = Path::new(".zed/settings.json"); + pub static ref LOCAL_TASKS_RELATIVE_PATH: &'static Path = Path::new(".zed/tasks.json"); + pub static ref LOCAL_VSCODE_TASKS_RELATIVE_PATH: &'static Path = Path::new(".vscode/tasks.json"); + pub static ref TEMP_DIR: PathBuf = if cfg!(target_os = "windows") { + dirs::cache_dir() + .expect("failed to determine LocalAppData directory") + .join("Zed") + } else if cfg!(target_os = "linux") { + if let Ok(flatpak_xdg_cache) = std::env::var("FLATPAK_XDG_CACHE_HOME") { + flatpak_xdg_cache.into() + } else { + dirs::cache_dir().expect("failed to determine XDG_CACHE_HOME directory") + }.join("zed") + } else { + HOME.join(".cache").join("zed") + }; +} diff --git a/crates/prettier/Cargo.toml b/crates/prettier/Cargo.toml index 586ff0770fe64efd217b43b08e6bc443a13b435f..54ea49bc5e546ae68d2d777e02089965d6ea2d52 100644 --- a/crates/prettier/Cargo.toml +++ b/crates/prettier/Cargo.toml @@ -25,6 +25,7 @@ log.workspace = true lsp.workspace = true node_runtime.workspace = true parking_lot.workspace = true +paths.workspace = true serde.workspace = true serde_json.workspace = true util.workspace = true diff --git a/crates/prettier/src/prettier.rs b/crates/prettier/src/prettier.rs index e6858531496fb22ab81266a008ec38af948c7258..17fc0b1044f5b95012f704ecb2adf014c4b31232 100644 --- a/crates/prettier/src/prettier.rs +++ b/crates/prettier/src/prettier.rs @@ -5,13 +5,14 @@ use gpui::{AsyncAppContext, Model}; use language::{language_settings::language_settings, Buffer, Diff}; use lsp::{LanguageServer, LanguageServerId}; use node_runtime::NodeRuntime; +use paths::DEFAULT_PRETTIER_DIR; use serde::{Deserialize, Serialize}; use std::{ ops::ControlFlow, path::{Path, PathBuf}, sync::Arc, }; -use util::paths::{PathMatcher, DEFAULT_PRETTIER_DIR}; +use util::paths::PathMatcher; #[derive(Clone)] pub enum Prettier { diff --git a/crates/project/Cargo.toml b/crates/project/Cargo.toml index fe8a7b444f6648e84ce3d61fecd0b59abb2bf992..d09fed32d76346f538ee1e62f80e32bb0a3d5f7d 100644 --- a/crates/project/Cargo.toml +++ b/crates/project/Cargo.toml @@ -45,6 +45,7 @@ lsp.workspace = true node_runtime.workspace = true parking_lot.workspace = true pathdiff.workspace = true +paths.workspace = true postage.workspace = true prettier.workspace = true worktree.workspace = true diff --git a/crates/project/src/prettier_support.rs b/crates/project/src/prettier_support.rs index 706c4372bb95d876d41bbc6f424110969ca28137..73ae697101187733493b4f62b7ae550480152824 100644 --- a/crates/project/src/prettier_support.rs +++ b/crates/project/src/prettier_support.rs @@ -18,8 +18,9 @@ use language::{ }; use lsp::{LanguageServer, LanguageServerId}; use node_runtime::NodeRuntime; +use paths::DEFAULT_PRETTIER_DIR; use prettier::Prettier; -use util::{paths::DEFAULT_PRETTIER_DIR, ResultExt, TryFutureExt}; +use util::{ResultExt, TryFutureExt}; use crate::{ Event, File, FormatOperation, PathChange, Project, ProjectEntryId, Worktree, WorktreeId, diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index b4832864b4712ea8251f8ec665c58a01625a0e3d..748a489524a4aa12afd917d23a5876d126746481 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -66,6 +66,9 @@ use lsp::{ use lsp_command::*; use node_runtime::NodeRuntime; use parking_lot::{Mutex, RwLock}; +use paths::{ + LOCAL_SETTINGS_RELATIVE_PATH, LOCAL_TASKS_RELATIVE_PATH, LOCAL_VSCODE_TASKS_RELATIVE_PATH, +}; use postage::watch; use prettier_support::{DefaultPrettier, PrettierInstance}; use project_settings::{LspSettings, ProjectSettings}; @@ -107,11 +110,8 @@ use terminals::Terminals; use text::{Anchor, BufferId, LineEnding}; use unicase::UniCase; use util::{ - debug_panic, defer, maybe, merge_json_value_into, parse_env_output, - paths::{ - LOCAL_SETTINGS_RELATIVE_PATH, LOCAL_TASKS_RELATIVE_PATH, LOCAL_VSCODE_TASKS_RELATIVE_PATH, - }, - post_inc, NumericPrefixWithSuffix, ResultExt, TryFutureExt as _, + debug_panic, defer, maybe, merge_json_value_into, parse_env_output, post_inc, + NumericPrefixWithSuffix, ResultExt, TryFutureExt as _, }; use worktree::{CreatedEntry, RemoteWorktreeClient, Snapshot, Traversal}; diff --git a/crates/rustdoc/Cargo.toml b/crates/rustdoc/Cargo.toml index f60fda46f8f05aeb6e5387c7c75d693f627dcb0d..9d63736de4d822d87bd8724dd42ff1d9483e3d66 100644 --- a/crates/rustdoc/Cargo.toml +++ b/crates/rustdoc/Cargo.toml @@ -25,6 +25,7 @@ html_to_markdown.workspace = true http.workspace = true indexmap.workspace = true parking_lot.workspace = true +paths.workspace = true serde.workspace = true strum.workspace = true util.workspace = true diff --git a/crates/rustdoc/src/store.rs b/crates/rustdoc/src/store.rs index 356233cedf1db72771f665f0373659ba8d069fba..7abd5cc858fb947c1985233b568023a8cf2c8b67 100644 --- a/crates/rustdoc/src/store.rs +++ b/crates/rustdoc/src/store.rs @@ -12,8 +12,8 @@ use gpui::{AppContext, BackgroundExecutor, Global, ReadGlobal, Task, UpdateGloba use heed::types::SerdeBincode; use heed::Database; use parking_lot::RwLock; +use paths::SUPPORT_DIR; use serde::{Deserialize, Serialize}; -use util::paths::SUPPORT_DIR; use util::ResultExt; use crate::indexer::{RustdocIndexer, RustdocProvider}; diff --git a/crates/settings/Cargo.toml b/crates/settings/Cargo.toml index 3177716196e35e706f6cf9d873d9ed819cc42473..25aece3cd09c85d014f5cdc9998d15c0dfbe5c97 100644 --- a/crates/settings/Cargo.toml +++ b/crates/settings/Cargo.toml @@ -22,6 +22,7 @@ fs.workspace = true futures.workspace = true gpui.workspace = true lazy_static.workspace = true +paths.workspace = true release_channel.workspace = true rust-embed.workspace = true schemars.workspace = true diff --git a/crates/settings/src/settings_file.rs b/crates/settings/src/settings_file.rs index d00a87f22ab72acdfccab727819af7eda4356fbd..ac4c8f1adcaf9892ee0bd86aa3d1331722624e4c 100644 --- a/crates/settings/src/settings_file.rs +++ b/crates/settings/src/settings_file.rs @@ -4,7 +4,7 @@ use fs::Fs; use futures::{channel::mpsc, StreamExt}; use gpui::{AppContext, BackgroundExecutor, UpdateGlobal}; use std::{io::ErrorKind, path::PathBuf, sync::Arc, time::Duration}; -use util::{paths, ResultExt}; +use util::ResultExt; pub const EMPTY_THEME_NAME: &str = "empty-theme"; diff --git a/crates/supermaven_api/Cargo.toml b/crates/supermaven_api/Cargo.toml index 6ab1dde0d8b4abb7cd790143c33d57ed6d456e55..d06e103f2c57dfb843f861dbe4634e21248c6bd2 100644 --- a/crates/supermaven_api/Cargo.toml +++ b/crates/supermaven_api/Cargo.toml @@ -16,7 +16,7 @@ doctest = false anyhow.workspace = true futures.workspace = true http.workspace = true +paths.workspace = true serde.workspace = true serde_json.workspace = true smol.workspace = true -util.workspace = true diff --git a/crates/supermaven_api/src/supermaven_api.rs b/crates/supermaven_api/src/supermaven_api.rs index 6b17256442adecf100072f6d235b7db19f82cbc5..75c39d314e565324b17916cc850e3238a0f6d6b1 100644 --- a/crates/supermaven_api/src/supermaven_api.rs +++ b/crates/supermaven_api/src/supermaven_api.rs @@ -2,12 +2,12 @@ use anyhow::{anyhow, Context, Result}; use futures::io::BufReader; use futures::{AsyncReadExt, Future}; use http::{AsyncBody, HttpClient, Request as HttpRequest}; +use paths::SUPERMAVEN_DIR; use serde::{Deserialize, Serialize}; use smol::fs::{self, File}; use smol::stream::StreamExt; use std::path::{Path, PathBuf}; use std::sync::Arc; -use util::paths::SUPERMAVEN_DIR; #[derive(Serialize)] pub struct GetExternalUserRequest { diff --git a/crates/terminal/Cargo.toml b/crates/terminal/Cargo.toml index a812619b959bc1ee2daf8a345cd3f7a9f0e62e0a..994702a446b307555607177b2549d7fd808100b4 100644 --- a/crates/terminal/Cargo.toml +++ b/crates/terminal/Cargo.toml @@ -17,7 +17,7 @@ doctest = false alacritty_terminal = { git = "https://github.com/alacritty/alacritty", rev = "cacdb5bb3b72bad2c729227537979d95af75978f" } anyhow.workspace = true collections.workspace = true -dirs = "4.0.0" +dirs.workspace = true futures.workspace = true gpui.workspace = true libc.workspace = true diff --git a/crates/terminal_view/Cargo.toml b/crates/terminal_view/Cargo.toml index f6e53bc22f69828ba51c50ade96aa7867c46440f..3067354aa01a420d844d9d2b5ed77de4c5d401ed 100644 --- a/crates/terminal_view/Cargo.toml +++ b/crates/terminal_view/Cargo.toml @@ -16,7 +16,7 @@ doctest = false anyhow.workspace = true db.workspace = true collections.workspace = true -dirs = "4.0.0" +dirs.workspace = true editor.workspace = true futures.workspace = true gpui.workspace = true diff --git a/crates/util/Cargo.toml b/crates/util/Cargo.toml index e381f9f5fd2740ab9a7ed60075a1aaabfc47c463..7ed17e8a04804a2eff66325e222a7e539ccfd7de 100644 --- a/crates/util/Cargo.toml +++ b/crates/util/Cargo.toml @@ -18,7 +18,7 @@ test-support = ["tempfile", "git2"] [dependencies] anyhow.workspace = true collections.workspace = true -dirs = "3.0" +dirs.workspace = true futures.workspace = true git2 = { workspace = true, optional = true } globset.workspace = true diff --git a/crates/util/src/paths.rs b/crates/util/src/paths.rs index 14aa1480ac90a2be951c0d92937c45ed19a04ccc..75aa226d0db296c56b941dc30ce58e5d5a3045ec 100644 --- a/crates/util/src/paths.rs +++ b/crates/util/src/paths.rs @@ -8,90 +8,6 @@ use serde::{Deserialize, Serialize}; lazy_static::lazy_static! { pub static ref HOME: PathBuf = dirs::home_dir().expect("failed to determine home directory"); - pub static ref CONFIG_DIR: PathBuf = if cfg!(target_os = "windows") { - dirs::config_dir() - .expect("failed to determine RoamingAppData directory") - .join("Zed") - } else if cfg!(target_os = "linux") { - if let Ok(flatpak_xdg_config) = std::env::var("FLATPAK_XDG_CONFIG_HOME") { - flatpak_xdg_config.into() - } else { - dirs::config_dir().expect("failed to determine XDG_CONFIG_HOME directory") - }.join("zed") - } else { - HOME.join(".config").join("zed") - }; - pub static ref CONTEXTS_DIR: PathBuf = if cfg!(target_os = "macos") { - CONFIG_DIR.join("conversations") - } else { - SUPPORT_DIR.join("conversations") - }; - pub static ref PROMPTS_DIR: PathBuf = if cfg!(target_os = "macos") { - CONFIG_DIR.join("prompts") - } else { - SUPPORT_DIR.join("prompts") - }; - pub static ref EMBEDDINGS_DIR: PathBuf = if cfg!(target_os = "macos") { - CONFIG_DIR.join("embeddings") - } else { - SUPPORT_DIR.join("embeddings") - }; - pub static ref THEMES_DIR: PathBuf = CONFIG_DIR.join("themes"); - - pub static ref SUPPORT_DIR: PathBuf = if cfg!(target_os = "macos") { - HOME.join("Library/Application Support/Zed") - } else if cfg!(target_os = "linux") { - if let Ok(flatpak_xdg_data) = std::env::var("FLATPAK_XDG_DATA_HOME") { - flatpak_xdg_data.into() - } else { - dirs::data_local_dir().expect("failed to determine XDG_DATA_HOME directory") - }.join("zed") - } else if cfg!(target_os = "windows") { - dirs::data_local_dir() - .expect("failed to determine LocalAppData directory") - .join("Zed") - } else { - CONFIG_DIR.clone() - }; - pub static ref LOGS_DIR: PathBuf = if cfg!(target_os = "macos") { - HOME.join("Library/Logs/Zed") - } else { - SUPPORT_DIR.join("logs") - }; - pub static ref EXTENSIONS_DIR: PathBuf = SUPPORT_DIR.join("extensions"); - pub static ref LANGUAGES_DIR: PathBuf = SUPPORT_DIR.join("languages"); - pub static ref COPILOT_DIR: PathBuf = SUPPORT_DIR.join("copilot"); - pub static ref SUPERMAVEN_DIR: PathBuf = SUPPORT_DIR.join("supermaven"); - pub static ref DEFAULT_PRETTIER_DIR: PathBuf = SUPPORT_DIR.join("prettier"); - pub static ref DB_DIR: PathBuf = SUPPORT_DIR.join("db"); - pub static ref CRASHES_DIR: Option = cfg!(target_os = "macos") - .then_some(HOME.join("Library/Logs/DiagnosticReports")); - pub static ref CRASHES_RETIRED_DIR: Option = CRASHES_DIR - .as_ref() - .map(|dir| dir.join("Retired")); - - pub static ref SETTINGS: PathBuf = CONFIG_DIR.join("settings.json"); - pub static ref KEYMAP: PathBuf = CONFIG_DIR.join("keymap.json"); - pub static ref TASKS: PathBuf = CONFIG_DIR.join("tasks.json"); - pub static ref LAST_USERNAME: PathBuf = CONFIG_DIR.join("last-username.txt"); - pub static ref LOG: PathBuf = LOGS_DIR.join("Zed.log"); - pub static ref OLD_LOG: PathBuf = LOGS_DIR.join("Zed.log.old"); - pub static ref LOCAL_SETTINGS_RELATIVE_PATH: &'static Path = Path::new(".zed/settings.json"); - pub static ref LOCAL_TASKS_RELATIVE_PATH: &'static Path = Path::new(".zed/tasks.json"); - pub static ref LOCAL_VSCODE_TASKS_RELATIVE_PATH: &'static Path = Path::new(".vscode/tasks.json"); - pub static ref TEMP_DIR: PathBuf = if cfg!(target_os = "windows") { - dirs::cache_dir() - .expect("failed to determine LocalAppData directory") - .join("Zed") - } else if cfg!(target_os = "linux") { - if let Ok(flatpak_xdg_cache) = std::env::var("FLATPAK_XDG_CACHE_HOME") { - flatpak_xdg_cache.into() - } else { - dirs::cache_dir().expect("failed to determine XDG_CACHE_HOME directory") - }.join("zed") - } else { - HOME.join(".cache").join("zed") - }; } pub trait PathExt { diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index 196a04540c63998fb54f7d7be40a549941770f6f..3f5fa158478fbffa78261161adb2bdfb768bca37 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -70,6 +70,7 @@ notifications.workspace = true outline.workspace = true outline_panel.workspace = true parking_lot.workspace = true +paths.workspace = true profiling.workspace = true project.workspace = true project_panel.workspace = true diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index f18d29f5841b01241df68031d430aa6fa2d20687..3ba31064c37890c01f2720bec14d1f0e97f926fd 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -40,7 +40,7 @@ use std::{ sync::Arc, }; use theme::{ActiveTheme, SystemAppearance, ThemeRegistry, ThemeSettings}; -use util::{maybe, parse_env_output, paths, with_clone, ResultExt, TryFutureExt}; +use util::{maybe, parse_env_output, with_clone, ResultExt, TryFutureExt}; use uuid::Uuid; use welcome::{show_welcome_view, BaseKeymap, FIRST_OPEN}; use workspace::{AppState, WorkspaceSettings, WorkspaceStore}; @@ -668,12 +668,12 @@ async fn restore_or_create_workspace( fn init_paths() -> anyhow::Result<()> { for path in [ - &*util::paths::CONFIG_DIR, - &*util::paths::EXTENSIONS_DIR, - &*util::paths::LANGUAGES_DIR, - &*util::paths::DB_DIR, - &*util::paths::LOGS_DIR, - &*util::paths::TEMP_DIR, + &*paths::CONFIG_DIR, + &*paths::EXTENSIONS_DIR, + &*paths::LANGUAGES_DIR, + &*paths::DB_DIR, + &*paths::LOGS_DIR, + &*paths::TEMP_DIR, ] .iter() { diff --git a/crates/zed/src/reliability.rs b/crates/zed/src/reliability.rs index ca774c708c9c12715c89f3f8fe0b33c17e439a82..0c73bb08e49db3f8e02d77cd996dcd9d3a7aa61a 100644 --- a/crates/zed/src/reliability.rs +++ b/crates/zed/src/reliability.rs @@ -22,7 +22,7 @@ use std::{io::Write, panic, sync::atomic::AtomicU32, thread}; use telemetry_events::LocationData; use telemetry_events::Panic; use telemetry_events::PanicRequest; -use util::{paths, ResultExt}; +use util::ResultExt; use crate::stdout_is_a_pty; static PANIC_COUNT: AtomicU32 = AtomicU32::new(0); diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index f7f1ac0d1f2dcf2a9fa9ee59fd55ce879a26aa11..b7ab71ab939185371cdeba638b70a299f6c9a651 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -36,12 +36,9 @@ use task::static_source::{StaticSource, TrackedFile}; use theme::ActiveTheme; use workspace::notifications::NotificationId; +use paths::{LOCAL_SETTINGS_RELATIVE_PATH, LOCAL_TASKS_RELATIVE_PATH}; use terminal_view::terminal_panel::{self, TerminalPanel}; -use util::{ - asset_str, - paths::{self, LOCAL_SETTINGS_RELATIVE_PATH, LOCAL_TASKS_RELATIVE_PATH}, - ResultExt, -}; +use util::{asset_str, ResultExt}; use uuid::Uuid; use vim::VimModeSetting; use welcome::BaseKeymap; diff --git a/crates/zed/src/zed/open_listener.rs b/crates/zed/src/zed/open_listener.rs index d6053f0daad2c37922681bd897ca53bff0c49098..d5e49351ffc3a3d94b6bc43b3555d5546edf1e41 100644 --- a/crates/zed/src/zed/open_listener.rs +++ b/crates/zed/src/zed/open_listener.rs @@ -113,7 +113,6 @@ impl OpenListener { pub fn listen_for_cli_connections(opener: OpenListener) -> Result<()> { use release_channel::RELEASE_CHANNEL_NAME; use std::os::unix::net::UnixDatagram; - use util::paths; let sock_path = paths::SUPPORT_DIR.join(format!("zed-{}.sock", *RELEASE_CHANNEL_NAME)); // remove the socket if the process listening on it has died