aboutsummaryrefslogtreecommitdiff
path: root/helix-loader/src/config.rs
diff options
context:
space:
mode:
authorPascal Kuthe2023-01-30 23:31:21 +0000
committerBlaž Hrastnik2023-03-29 03:57:30 +0000
commit2d10a429ebf7abe5af184b6227346377dc0523e8 (patch)
tree114b19f0031fc001d7798a31372675a94623262f /helix-loader/src/config.rs
parentd59b80514e15d26f280a9b0dbd18afac08578638 (diff)
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>
Diffstat (limited to 'helix-loader/src/config.rs')
-rw-r--r--helix-loader/src/config.rs8
1 files changed, 3 insertions, 5 deletions
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<toml::Value, toml::de::Error> {
- 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<toml::Value, toml::de::Error> {
})
.collect::<Result<Vec<_>, _>>()?
.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<toml::Value, toml::de::Error> {
// 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)