Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-loader/src/lib.rs')
-rw-r--r--helix-loader/src/lib.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs
index 9872b77a..2e3b760d 100644
--- a/helix-loader/src/lib.rs
+++ b/helix-loader/src/lib.rs
@@ -1,5 +1,6 @@
pub mod config;
pub mod grammar;
+pub mod workspace_trust;
use helix_stdx::{env::current_working_dir, path};
@@ -132,6 +133,13 @@ pub fn cache_dir() -> PathBuf {
path
}
+pub fn data_dir() -> PathBuf {
+ let strategy = choose_base_strategy().expect("Unable to find the data directory!");
+ let mut path = strategy.data_dir();
+ path.push("helix");
+ path
+}
+
pub fn config_file() -> PathBuf {
CONFIG_FILE.get().map(|path| path.to_path_buf()).unwrap()
}
@@ -144,6 +152,10 @@ pub fn workspace_config_file() -> PathBuf {
find_workspace().0.join(".helix").join("config.toml")
}
+pub fn workspace_lang_config_file() -> PathBuf {
+ find_workspace().0.join(".helix").join("languages.toml")
+}
+
pub fn lang_config_file() -> PathBuf {
config_dir().join("languages.toml")
}
@@ -152,6 +164,14 @@ pub fn default_log_file() -> PathBuf {
cache_dir().join("helix.log")
}
+pub fn workspace_trust_file() -> PathBuf {
+ data_dir().join("trusted_workspaces")
+}
+
+pub fn workspace_exclude_file() -> PathBuf {
+ data_dir().join("excluded_workspaces")
+}
+
/// Merge two TOML documents, merging values from `right` onto `left`
///
/// `merge_depth` sets the nesting depth up to which values are merged instead