From 194b09fbc1edb2d0ccdadc53ec0893f61dbded8e Mon Sep 17 00:00:00 2001 From: Gokul Soumya Date: Tue, 8 Mar 2022 10:55:46 +0530 Subject: Add --health command for troubleshooting (#1669) * Move runtime file location definitions to core * Add basic --health command * Add language specific --health * Show summary for all langs with bare --health * Use TsFeature from xtask for --health * cargo fmt Co-authored-by: Blaž Hrastnik --- helix-core/src/lib.rs | 12 ++++++++++++ helix-core/src/syntax.rs | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'helix-core/src') diff --git a/helix-core/src/lib.rs b/helix-core/src/lib.rs index 8e5950de..c3a349c1 100644 --- a/helix-core/src/lib.rs +++ b/helix-core/src/lib.rs @@ -124,6 +124,18 @@ pub fn cache_dir() -> std::path::PathBuf { path } +pub fn config_file() -> std::path::PathBuf { + config_dir().join("config.toml") +} + +pub fn lang_config_file() -> std::path::PathBuf { + config_dir().join("languages.toml") +} + +pub fn log_file() -> std::path::PathBuf { + cache_dir().join("helix.log") +} + // right overrides left pub fn merge_toml_values(left: toml::Value, right: toml::Value) -> toml::Value { use toml::Value; diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index f2939e3d..c39e0584 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -335,7 +335,7 @@ impl TextObjectQuery { } } -fn load_runtime_file(language: &str, filename: &str) -> Result { +pub fn load_runtime_file(language: &str, filename: &str) -> Result { let path = crate::RUNTIME_DIR .join("queries") .join(language) -- cgit v1.2.3-70-g09d2