Rename zed2 -> zed

Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
Max Brunsfeld 2024-01-03 10:08:26 -08:00
parent b594e59134
commit 7986ee18cd
237 changed files with 2971 additions and 18447 deletions

View file

@ -3,8 +3,9 @@ use gpui::AppContext;
pub use language::*;
use node_runtime::NodeRuntime;
use rust_embed::RustEmbed;
use settings::Settings;
use std::{borrow::Cow, str, sync::Arc};
use util::asset_str;
use util::{asset_str, paths::PLUGINS_DIR};
use self::elixir::ElixirSettings;
@ -48,7 +49,7 @@ pub fn init(
node_runtime: Arc<dyn NodeRuntime>,
cx: &mut AppContext,
) {
settings::register::<elixir::ElixirSettings>(cx);
ElixirSettings::register(cx);
let language = |name, grammar, adapters| {
languages.register(name, load_config(name), grammar, adapters, load_queries)
@ -74,7 +75,7 @@ pub fn init(
],
);
match &settings::get::<ElixirSettings>(cx).lsp {
match &ElixirSettings::get(None, cx).lsp {
elixir::ElixirLspSetting::ElixirLs => language(
"elixir",
tree_sitter_elixir::language(),
@ -227,6 +228,21 @@ pub fn init(
tree_sitter_uiua::language(),
vec![Arc::new(uiua::UiuaLanguageServer {})],
);
if let Ok(children) = std::fs::read_dir(&*PLUGINS_DIR) {
for child in children {
if let Ok(child) = child {
let path = child.path();
let config_path = path.join("config.toml");
if let Ok(config) = std::fs::read(&config_path) {
let config: LanguageConfig = toml::from_slice(&config).unwrap();
if let Some(grammar_name) = config.grammar_name.clone() {
languages.register_wasm(path.into(), grammar_name, config);
}
}
}
}
}
}
#[cfg(any(test, feature = "test-support"))]