From 2d10a429ebf7abe5af184b6227346377dc0523e8 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Tue, 31 Jan 2023 00:31:21 +0100 Subject: add workspace config and manual LSP root management fixup documentation Co-authored-by: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> fixup typo Co-authored-by: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> --- helix-loader/src/config.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'helix-loader/src/config.rs') diff --git a/helix-loader/src/config.rs b/helix-loader/src/config.rs index 0f329d21..8924c8fb 100644 --- a/helix-loader/src/config.rs +++ b/helix-loader/src/config.rs @@ -9,9 +9,8 @@ pub fn default_lang_config() -> toml::Value { /// User configured languages.toml file, merged with the default config. pub fn user_lang_config() -> Result { - let config = crate::local_config_dirs() + let config = [crate::config_dir(), crate::find_workspace().join(".helix")] .into_iter() - .chain([crate::config_dir()].into_iter()) .map(|path| path.join("languages.toml")) .filter_map(|file| { std::fs::read_to_string(file) @@ -20,8 +19,7 @@ pub fn user_lang_config() -> Result { }) .collect::, _>>()? .into_iter() - .chain([default_lang_config()].into_iter()) - .fold(toml::Value::Table(toml::value::Table::default()), |a, b| { + .fold(default_lang_config(), |a, b| { // combines for example // b: // [[language]] @@ -38,7 +36,7 @@ pub fn user_lang_config() -> Result { // language-server = { command = "/usr/bin/taplo" } // // thus it overrides the third depth-level of b with values of a if they exist, but otherwise merges their values - crate::merge_toml_values(b, a, 3) + crate::merge_toml_values(a, b, 3) }); Ok(config) -- cgit v1.2.3-70-g09d2