Rename extension crate to extension_host (#20081)

This PR renames the `extension` crate to `extension_host`.

This is to free up the name so that we can create a smaller-scoped
`extension` crate.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-11-01 12:53:02 -04:00 committed by GitHub
parent c8f1969916
commit ea44c510a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 46 additions and 45 deletions

52
Cargo.lock generated
View file

@ -9,7 +9,7 @@ dependencies = [
"anyhow",
"auto_update",
"editor",
"extension",
"extension_host",
"futures 0.3.30",
"gpui",
"language",
@ -4090,7 +4090,29 @@ dependencies = [
]
[[package]]
name = "extension"
name = "extension_cli"
version = "0.1.0"
dependencies = [
"anyhow",
"clap",
"env_logger 0.11.5",
"extension_host",
"fs",
"language",
"log",
"reqwest_client",
"rpc",
"serde",
"serde_json",
"theme",
"tokio",
"toml 0.8.19",
"tree-sitter",
"wasmtime",
]
[[package]]
name = "extension_host"
version = "0.1.0"
dependencies = [
"anyhow",
@ -4137,28 +4159,6 @@ dependencies = [
"workspace",
]
[[package]]
name = "extension_cli"
version = "0.1.0"
dependencies = [
"anyhow",
"clap",
"env_logger 0.11.5",
"extension",
"fs",
"language",
"log",
"reqwest_client",
"rpc",
"serde",
"serde_json",
"theme",
"tokio",
"toml 0.8.19",
"tree-sitter",
"wasmtime",
]
[[package]]
name = "extensions_ui"
version = "0.1.0"
@ -4168,7 +4168,7 @@ dependencies = [
"collections",
"db",
"editor",
"extension",
"extension_host",
"fs",
"fuzzy",
"gpui",
@ -15065,7 +15065,7 @@ dependencies = [
"diagnostics",
"editor",
"env_logger 0.11.5",
"extension",
"extension_host",
"extensions_ui",
"feature_flags",
"feedback",

View file

@ -27,9 +27,9 @@ members = [
"crates/docs_preprocessor",
"crates/editor",
"crates/evals",
"crates/extension",
"crates/extension_api",
"crates/extension_cli",
"crates/extension_host",
"crates/extensions_ui",
"crates/feature_flags",
"crates/feedback",
@ -201,7 +201,7 @@ copilot = { path = "crates/copilot" }
db = { path = "crates/db" }
diagnostics = { path = "crates/diagnostics" }
editor = { path = "crates/editor" }
extension = { path = "crates/extension" }
extension_host = { path = "crates/extension_host" }
extensions_ui = { path = "crates/extensions_ui" }
feature_flags = { path = "crates/feature_flags" }
feedback = { path = "crates/feedback" }

View file

@ -16,7 +16,7 @@ doctest = false
anyhow.workspace = true
auto_update.workspace = true
editor.workspace = true
extension.workspace = true
extension_host.workspace = true
futures.workspace = true
gpui.workspace = true
language.workspace = true

View file

@ -1,6 +1,6 @@
use auto_update::{AutoUpdateStatus, AutoUpdater, DismissErrorMessage};
use editor::Editor;
use extension::ExtensionStore;
use extension_host::ExtensionStore;
use futures::StreamExt;
use gpui::{
actions, percentage, Animation, AnimationExt as _, AppContext, CursorStyle, EventEmitter,

View file

@ -16,7 +16,7 @@ path = "src/main.rs"
anyhow.workspace = true
clap = { workspace = true, features = ["derive"] }
env_logger.workspace = true
extension = { workspace = true, features = ["no-webrtc"] }
extension_host = { workspace = true, features = ["no-webrtc"] }
fs.workspace = true
language.workspace = true
log.workspace = true

View file

@ -9,7 +9,7 @@ use std::{
use ::fs::{copy_recursive, CopyOptions, Fs, RealFs};
use anyhow::{anyhow, bail, Context, Result};
use clap::Parser;
use extension::{
use extension_host::{
extension_builder::{CompileExtensionOptions, ExtensionBuilder},
ExtensionManifest,
};

View file

@ -1,5 +1,5 @@
[package]
name = "extension"
name = "extension_host"
version = "0.1.0"
edition = "2021"
publish = false
@ -9,7 +9,7 @@ license = "GPL-3.0-or-later"
workspace = true
[lib]
path = "src/extension_store.rs"
path = "src/extension_host.rs"
doctest = false
[features]

View file

@ -20,7 +20,7 @@ client.workspace = true
collections.workspace = true
db.workspace = true
editor.workspace = true
extension.workspace = true
extension_host.workspace = true
fs.workspace = true
fuzzy.workspace = true
gpui.workspace = true

View file

@ -4,7 +4,7 @@ use std::sync::{Arc, OnceLock};
use db::kvp::KEY_VALUE_STORE;
use editor::Editor;
use extension::ExtensionStore;
use extension_host::ExtensionStore;
use gpui::{Model, VisualContext};
use language::Buffer;
use ui::{SharedString, ViewContext};

View file

@ -2,7 +2,7 @@ use std::str::FromStr;
use std::sync::Arc;
use client::ExtensionMetadata;
use extension::{ExtensionSettings, ExtensionStore};
use extension_host::{ExtensionSettings, ExtensionStore};
use fs::Fs;
use fuzzy::{match_strings, StringMatch, StringMatchCandidate};
use gpui::{
@ -167,7 +167,7 @@ impl PickerDelegate for ExtensionVersionSelectorDelegate {
let candidate_id = self.matches[self.selected_index].candidate_id;
let extension_version = &self.extension_versions[candidate_id];
if !extension::is_version_compatible(ReleaseChannel::global(cx), extension_version) {
if !extension_host::is_version_compatible(ReleaseChannel::global(cx), extension_version) {
return;
}
@ -203,7 +203,7 @@ impl PickerDelegate for ExtensionVersionSelectorDelegate {
let extension_version = &self.extension_versions[version_match.candidate_id];
let is_version_compatible =
extension::is_version_compatible(ReleaseChannel::global(cx), extension_version);
extension_host::is_version_compatible(ReleaseChannel::global(cx), extension_version);
let disabled = !is_version_compatible;
Some(

View file

@ -11,7 +11,7 @@ use client::telemetry::Telemetry;
use client::ExtensionMetadata;
use collections::{BTreeMap, BTreeSet};
use editor::{Editor, EditorElement, EditorStyle};
use extension::{ExtensionManifest, ExtensionOperation, ExtensionStore};
use extension_host::{ExtensionManifest, ExtensionOperation, ExtensionStore};
use fuzzy::{match_strings, StringMatchCandidate};
use gpui::{
actions, uniform_list, AppContext, EventEmitter, Flatten, FocusableView, InteractiveElement,
@ -203,8 +203,8 @@ impl ExtensionsPage {
let subscriptions = [
cx.observe(&store, |_, _, cx| cx.notify()),
cx.subscribe(&store, move |this, _, event, cx| match event {
extension::Event::ExtensionsUpdated => this.fetch_extensions_debounced(cx),
extension::Event::ExtensionInstalled(extension_id) => {
extension_host::Event::ExtensionsUpdated => this.fetch_extensions_debounced(cx),
extension_host::Event::ExtensionInstalled(extension_id) => {
this.on_extension_installed(workspace_handle.clone(), extension_id, cx)
}
_ => {}
@ -691,7 +691,8 @@ impl ExtensionsPage {
has_dev_extension: bool,
cx: &mut ViewContext<Self>,
) -> (Button, Option<Button>) {
let is_compatible = extension::is_version_compatible(ReleaseChannel::global(cx), extension);
let is_compatible =
extension_host::is_version_compatible(ReleaseChannel::global(cx), extension);
if has_dev_extension {
// If we have a dev extension for the given extension, just treat it as uninstalled.

View file

@ -39,7 +39,7 @@ db.workspace = true
diagnostics.workspace = true
editor.workspace = true
env_logger.workspace = true
extension.workspace = true
extension_host.workspace = true
extensions_ui.workspace = true
feature_flags.workspace = true
feedback.workspace = true

View file

@ -402,7 +402,7 @@ fn main() {
app_state.client.telemetry().clone(),
cx,
);
extension::init(
extension_host::init(
app_state.fs.clone(),
app_state.client.clone(),
app_state.node_runtime.clone(),