diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 57b9e5c3a..ac689eb38 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -964,7 +964,7 @@ mod test { use super::*; use crate::{Rope, Transaction}; - static LOADER: Lazy = Lazy::new(|| crate::config::user_lang_loader().unwrap()); + static LOADER: Lazy = Lazy::new(crate::config::default_lang_loader); #[test] fn test_textobject_queries() { diff --git a/xtask/src/docgen.rs b/xtask/src/docgen.rs index 2b58e7329..d31c396df 100644 --- a/xtask/src/docgen.rs +++ b/xtask/src/docgen.rs @@ -129,7 +129,7 @@ pub fn lang_features() -> Result { cols.push("Default language servers".to_owned()); md.push_str(&md_table_heading(&cols)); - let config = helpers::lang_config(); + let config = helix_core::config::default_lang_config(); let mut langs = config .language diff --git a/xtask/src/helpers.rs b/xtask/src/helpers.rs index 9bdca5618..0156f2534 100644 --- a/xtask/src/helpers.rs +++ b/xtask/src/helpers.rs @@ -1,7 +1,6 @@ use std::path::{Path, PathBuf}; use crate::path; -use helix_core::syntax::{self, config::Configuration as LangConfig}; use helix_term::health::TsFeature; /// Get the list of languages that support a particular tree-sitter @@ -37,12 +36,3 @@ pub fn find_files(dir: &Path, filename: &str) -> Vec { .flatten() .collect() } - -pub fn lang_config() -> LangConfig { - let text = std::fs::read_to_string(path::lang_config()).unwrap(); - toml::from_str(&text).unwrap() -} - -pub fn syn_loader() -> syntax::Loader { - syntax::Loader::new(lang_config()).unwrap() -} diff --git a/xtask/src/main.rs b/xtask/src/main.rs index c6875d95a..d4995ce35 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -22,7 +22,7 @@ pub mod tasks { use helix_core::syntax::LanguageData; let languages_to_check: HashSet<_> = languages.collect(); - let loader = crate::helpers::syn_loader(); + let loader = helix_core::config::default_lang_loader(); for (_language, lang_data) in loader.languages() { if !languages_to_check.is_empty() && !languages_to_check.contains(&lang_data.config().language_id) diff --git a/xtask/src/path.rs b/xtask/src/path.rs index cf8e8792e..a46bdda06 100644 --- a/xtask/src/path.rs +++ b/xtask/src/path.rs @@ -22,7 +22,3 @@ pub fn ts_queries() -> PathBuf { pub fn themes() -> PathBuf { runtime().join("themes") } - -pub fn lang_config() -> PathBuf { - project_root().join("languages.toml") -}