Extension refactor (#20305)

This contains the main changes to the extensions crate from #20049. The
primary goal here is removing dependencies that we can't include on the
remote.


Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
This commit is contained in:
Conrad Irwin 2024-11-06 10:06:25 -07:00 committed by GitHub
parent f22e56ff42
commit 608addf641
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 675 additions and 236 deletions

View file

@ -15,6 +15,7 @@ name = "zed"
path = "src/main.rs"
[dependencies]
assistant_slash_command.workspace = true
activity_indicator.workspace = true
anyhow.workspace = true
assets.workspace = true
@ -53,6 +54,7 @@ go_to_line.workspace = true
gpui = { workspace = true, features = ["wayland", "x11", "font-kit"] }
http_client.workspace = true
image_viewer.workspace = true
indexed_docs.workspace = true
inline_completion_button.workspace = true
install_cli.workspace = true
journal.workspace = true

View file

@ -7,6 +7,7 @@ mod reliability;
mod zed;
use anyhow::{anyhow, Context as _, Result};
use assistant_slash_command::SlashCommandRegistry;
use chrono::Offset;
use clap::{command, Parser};
use cli::FORCE_CLI_MODE_ENV_VAR_NAME;
@ -23,6 +24,7 @@ use gpui::{
VisualContext,
};
use http_client::{read_proxy_from_env, Uri};
use indexed_docs::IndexedDocsRegistry;
use language::LanguageRegistry;
use log::LevelFilter;
use reqwest_client::ReqwestClient;
@ -39,6 +41,7 @@ use settings::{
};
use simplelog::ConfigBuilder;
use smol::process::Command;
use snippet_provider::SnippetRegistry;
use std::{
env,
fs::OpenOptions,
@ -402,12 +405,19 @@ fn main() {
app_state.client.telemetry().clone(),
cx,
);
let api = extensions_ui::ConcreteExtensionRegistrationHooks::new(
ThemeRegistry::global(cx),
SlashCommandRegistry::global(cx),
IndexedDocsRegistry::global(cx),
SnippetRegistry::global(cx),
app_state.languages.clone(),
cx,
);
extension_host::init(
api,
app_state.fs.clone(),
app_state.client.clone(),
app_state.node_runtime.clone(),
app_state.languages.clone(),
ThemeRegistry::global(cx),
cx,
);
recent_projects::init(cx);

View file

@ -495,10 +495,7 @@ async fn upload_panic(
) -> Result<bool> {
*most_recent_panic = Some((panic.panicked_on, panic.payload.clone()));
let json_bytes = serde_json::to_vec(&PanicRequest {
panic: panic.clone(),
})
.unwrap();
let json_bytes = serde_json::to_vec(&PanicRequest { panic }).unwrap();
let Some(checksum) = client::telemetry::calculate_json_checksum(&json_bytes) else {
return Ok(false);