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:
parent
c8f1969916
commit
ea44c510a3
30 changed files with 46 additions and 45 deletions
52
Cargo.lock
generated
52
Cargo.lock
generated
|
@ -9,7 +9,7 @@ dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"auto_update",
|
"auto_update",
|
||||||
"editor",
|
"editor",
|
||||||
"extension",
|
"extension_host",
|
||||||
"futures 0.3.30",
|
"futures 0.3.30",
|
||||||
"gpui",
|
"gpui",
|
||||||
"language",
|
"language",
|
||||||
|
@ -4090,7 +4090,29 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[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"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
@ -4137,28 +4159,6 @@ dependencies = [
|
||||||
"workspace",
|
"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]]
|
[[package]]
|
||||||
name = "extensions_ui"
|
name = "extensions_ui"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
@ -4168,7 +4168,7 @@ dependencies = [
|
||||||
"collections",
|
"collections",
|
||||||
"db",
|
"db",
|
||||||
"editor",
|
"editor",
|
||||||
"extension",
|
"extension_host",
|
||||||
"fs",
|
"fs",
|
||||||
"fuzzy",
|
"fuzzy",
|
||||||
"gpui",
|
"gpui",
|
||||||
|
@ -15065,7 +15065,7 @@ dependencies = [
|
||||||
"diagnostics",
|
"diagnostics",
|
||||||
"editor",
|
"editor",
|
||||||
"env_logger 0.11.5",
|
"env_logger 0.11.5",
|
||||||
"extension",
|
"extension_host",
|
||||||
"extensions_ui",
|
"extensions_ui",
|
||||||
"feature_flags",
|
"feature_flags",
|
||||||
"feedback",
|
"feedback",
|
||||||
|
|
|
@ -27,9 +27,9 @@ members = [
|
||||||
"crates/docs_preprocessor",
|
"crates/docs_preprocessor",
|
||||||
"crates/editor",
|
"crates/editor",
|
||||||
"crates/evals",
|
"crates/evals",
|
||||||
"crates/extension",
|
|
||||||
"crates/extension_api",
|
"crates/extension_api",
|
||||||
"crates/extension_cli",
|
"crates/extension_cli",
|
||||||
|
"crates/extension_host",
|
||||||
"crates/extensions_ui",
|
"crates/extensions_ui",
|
||||||
"crates/feature_flags",
|
"crates/feature_flags",
|
||||||
"crates/feedback",
|
"crates/feedback",
|
||||||
|
@ -201,7 +201,7 @@ copilot = { path = "crates/copilot" }
|
||||||
db = { path = "crates/db" }
|
db = { path = "crates/db" }
|
||||||
diagnostics = { path = "crates/diagnostics" }
|
diagnostics = { path = "crates/diagnostics" }
|
||||||
editor = { path = "crates/editor" }
|
editor = { path = "crates/editor" }
|
||||||
extension = { path = "crates/extension" }
|
extension_host = { path = "crates/extension_host" }
|
||||||
extensions_ui = { path = "crates/extensions_ui" }
|
extensions_ui = { path = "crates/extensions_ui" }
|
||||||
feature_flags = { path = "crates/feature_flags" }
|
feature_flags = { path = "crates/feature_flags" }
|
||||||
feedback = { path = "crates/feedback" }
|
feedback = { path = "crates/feedback" }
|
||||||
|
|
|
@ -16,7 +16,7 @@ doctest = false
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
auto_update.workspace = true
|
auto_update.workspace = true
|
||||||
editor.workspace = true
|
editor.workspace = true
|
||||||
extension.workspace = true
|
extension_host.workspace = true
|
||||||
futures.workspace = true
|
futures.workspace = true
|
||||||
gpui.workspace = true
|
gpui.workspace = true
|
||||||
language.workspace = true
|
language.workspace = true
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use auto_update::{AutoUpdateStatus, AutoUpdater, DismissErrorMessage};
|
use auto_update::{AutoUpdateStatus, AutoUpdater, DismissErrorMessage};
|
||||||
use editor::Editor;
|
use editor::Editor;
|
||||||
use extension::ExtensionStore;
|
use extension_host::ExtensionStore;
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
actions, percentage, Animation, AnimationExt as _, AppContext, CursorStyle, EventEmitter,
|
actions, percentage, Animation, AnimationExt as _, AppContext, CursorStyle, EventEmitter,
|
||||||
|
|
|
@ -16,7 +16,7 @@ path = "src/main.rs"
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
clap = { workspace = true, features = ["derive"] }
|
clap = { workspace = true, features = ["derive"] }
|
||||||
env_logger.workspace = true
|
env_logger.workspace = true
|
||||||
extension = { workspace = true, features = ["no-webrtc"] }
|
extension_host = { workspace = true, features = ["no-webrtc"] }
|
||||||
fs.workspace = true
|
fs.workspace = true
|
||||||
language.workspace = true
|
language.workspace = true
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
|
|
|
@ -9,7 +9,7 @@ use std::{
|
||||||
use ::fs::{copy_recursive, CopyOptions, Fs, RealFs};
|
use ::fs::{copy_recursive, CopyOptions, Fs, RealFs};
|
||||||
use anyhow::{anyhow, bail, Context, Result};
|
use anyhow::{anyhow, bail, Context, Result};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use extension::{
|
use extension_host::{
|
||||||
extension_builder::{CompileExtensionOptions, ExtensionBuilder},
|
extension_builder::{CompileExtensionOptions, ExtensionBuilder},
|
||||||
ExtensionManifest,
|
ExtensionManifest,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "extension"
|
name = "extension_host"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
@ -9,7 +9,7 @@ license = "GPL-3.0-or-later"
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
path = "src/extension_store.rs"
|
path = "src/extension_host.rs"
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
[features]
|
[features]
|
|
@ -20,7 +20,7 @@ client.workspace = true
|
||||||
collections.workspace = true
|
collections.workspace = true
|
||||||
db.workspace = true
|
db.workspace = true
|
||||||
editor.workspace = true
|
editor.workspace = true
|
||||||
extension.workspace = true
|
extension_host.workspace = true
|
||||||
fs.workspace = true
|
fs.workspace = true
|
||||||
fuzzy.workspace = true
|
fuzzy.workspace = true
|
||||||
gpui.workspace = true
|
gpui.workspace = true
|
||||||
|
|
|
@ -4,7 +4,7 @@ use std::sync::{Arc, OnceLock};
|
||||||
|
|
||||||
use db::kvp::KEY_VALUE_STORE;
|
use db::kvp::KEY_VALUE_STORE;
|
||||||
use editor::Editor;
|
use editor::Editor;
|
||||||
use extension::ExtensionStore;
|
use extension_host::ExtensionStore;
|
||||||
use gpui::{Model, VisualContext};
|
use gpui::{Model, VisualContext};
|
||||||
use language::Buffer;
|
use language::Buffer;
|
||||||
use ui::{SharedString, ViewContext};
|
use ui::{SharedString, ViewContext};
|
||||||
|
|
|
@ -2,7 +2,7 @@ use std::str::FromStr;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use client::ExtensionMetadata;
|
use client::ExtensionMetadata;
|
||||||
use extension::{ExtensionSettings, ExtensionStore};
|
use extension_host::{ExtensionSettings, ExtensionStore};
|
||||||
use fs::Fs;
|
use fs::Fs;
|
||||||
use fuzzy::{match_strings, StringMatch, StringMatchCandidate};
|
use fuzzy::{match_strings, StringMatch, StringMatchCandidate};
|
||||||
use gpui::{
|
use gpui::{
|
||||||
|
@ -167,7 +167,7 @@ impl PickerDelegate for ExtensionVersionSelectorDelegate {
|
||||||
let candidate_id = self.matches[self.selected_index].candidate_id;
|
let candidate_id = self.matches[self.selected_index].candidate_id;
|
||||||
let extension_version = &self.extension_versions[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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ impl PickerDelegate for ExtensionVersionSelectorDelegate {
|
||||||
let extension_version = &self.extension_versions[version_match.candidate_id];
|
let extension_version = &self.extension_versions[version_match.candidate_id];
|
||||||
|
|
||||||
let is_version_compatible =
|
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;
|
let disabled = !is_version_compatible;
|
||||||
|
|
||||||
Some(
|
Some(
|
||||||
|
|
|
@ -11,7 +11,7 @@ use client::telemetry::Telemetry;
|
||||||
use client::ExtensionMetadata;
|
use client::ExtensionMetadata;
|
||||||
use collections::{BTreeMap, BTreeSet};
|
use collections::{BTreeMap, BTreeSet};
|
||||||
use editor::{Editor, EditorElement, EditorStyle};
|
use editor::{Editor, EditorElement, EditorStyle};
|
||||||
use extension::{ExtensionManifest, ExtensionOperation, ExtensionStore};
|
use extension_host::{ExtensionManifest, ExtensionOperation, ExtensionStore};
|
||||||
use fuzzy::{match_strings, StringMatchCandidate};
|
use fuzzy::{match_strings, StringMatchCandidate};
|
||||||
use gpui::{
|
use gpui::{
|
||||||
actions, uniform_list, AppContext, EventEmitter, Flatten, FocusableView, InteractiveElement,
|
actions, uniform_list, AppContext, EventEmitter, Flatten, FocusableView, InteractiveElement,
|
||||||
|
@ -203,8 +203,8 @@ impl ExtensionsPage {
|
||||||
let subscriptions = [
|
let subscriptions = [
|
||||||
cx.observe(&store, |_, _, cx| cx.notify()),
|
cx.observe(&store, |_, _, cx| cx.notify()),
|
||||||
cx.subscribe(&store, move |this, _, event, cx| match event {
|
cx.subscribe(&store, move |this, _, event, cx| match event {
|
||||||
extension::Event::ExtensionsUpdated => this.fetch_extensions_debounced(cx),
|
extension_host::Event::ExtensionsUpdated => this.fetch_extensions_debounced(cx),
|
||||||
extension::Event::ExtensionInstalled(extension_id) => {
|
extension_host::Event::ExtensionInstalled(extension_id) => {
|
||||||
this.on_extension_installed(workspace_handle.clone(), extension_id, cx)
|
this.on_extension_installed(workspace_handle.clone(), extension_id, cx)
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
@ -691,7 +691,8 @@ impl ExtensionsPage {
|
||||||
has_dev_extension: bool,
|
has_dev_extension: bool,
|
||||||
cx: &mut ViewContext<Self>,
|
cx: &mut ViewContext<Self>,
|
||||||
) -> (Button, Option<Button>) {
|
) -> (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 has_dev_extension {
|
||||||
// If we have a dev extension for the given extension, just treat it as uninstalled.
|
// If we have a dev extension for the given extension, just treat it as uninstalled.
|
||||||
|
|
|
@ -39,7 +39,7 @@ db.workspace = true
|
||||||
diagnostics.workspace = true
|
diagnostics.workspace = true
|
||||||
editor.workspace = true
|
editor.workspace = true
|
||||||
env_logger.workspace = true
|
env_logger.workspace = true
|
||||||
extension.workspace = true
|
extension_host.workspace = true
|
||||||
extensions_ui.workspace = true
|
extensions_ui.workspace = true
|
||||||
feature_flags.workspace = true
|
feature_flags.workspace = true
|
||||||
feedback.workspace = true
|
feedback.workspace = true
|
||||||
|
|
|
@ -402,7 +402,7 @@ fn main() {
|
||||||
app_state.client.telemetry().clone(),
|
app_state.client.telemetry().clone(),
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
extension::init(
|
extension_host::init(
|
||||||
app_state.fs.clone(),
|
app_state.fs.clone(),
|
||||||
app_state.client.clone(),
|
app_state.client.clone(),
|
||||||
app_state.node_runtime.clone(),
|
app_state.node_runtime.clone(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue