From 7a05461c50219a7cd3a63747b98019a3b5fa3f01 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 5 Oct 2021 15:43:57 +0200 Subject: [PATCH] Avoid loading Rust grammar in `zed` tests --- crates/zed/src/language.rs | 2 +- crates/zed/src/test.rs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/zed/src/language.rs b/crates/zed/src/language.rs index f86fb0d44d..af0581ed8d 100644 --- a/crates/zed/src/language.rs +++ b/crates/zed/src/language.rs @@ -14,7 +14,7 @@ pub fn build_language_registry() -> LanguageRegistry { languages } -pub fn rust() -> Language { +fn rust() -> Language { let grammar = tree_sitter_rust::language(); let rust_config = toml::from_slice(&LanguageDir::get("rust/config.toml").unwrap().data).unwrap(); diff --git a/crates/zed/src/test.rs b/crates/zed/src/test.rs index 793f73470e..3f9161a066 100644 --- a/crates/zed/src/test.rs +++ b/crates/zed/src/test.rs @@ -1,4 +1,4 @@ -use crate::{assets::Assets, language, AppState}; +use crate::{assets::Assets, AppState}; use buffer::LanguageRegistry; use client::{http::ServerResponse, test::FakeHttpClient, ChannelList, Client, UserStore}; use gpui::{AssetSource, MutableAppContext}; @@ -17,8 +17,6 @@ fn init_logger() { pub fn test_app_state(cx: &mut MutableAppContext) -> Arc { let (settings_tx, settings) = watch::channel_with(build_settings(cx)); - let mut languages = LanguageRegistry::new(); - languages.add(Arc::new(language::rust())); let themes = ThemeRegistry::new(Assets, cx.font_cache().clone()); let client = Client::new(); let http = FakeHttpClient::new(|_| async move { Ok(ServerResponse::new(404)) }); @@ -27,7 +25,7 @@ pub fn test_app_state(cx: &mut MutableAppContext) -> Arc { settings_tx: Arc::new(Mutex::new(settings_tx)), settings, themes, - languages: Arc::new(languages), + languages: Arc::new(LanguageRegistry::new()), channel_list: cx.add_model(|cx| ChannelList::new(user_store.clone(), client.clone(), cx)), client, user_store,