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

@ -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);