diff options
author | Gokul Soumya | 2022-03-08 05:25:46 +0000 |
---|---|---|
committer | GitHub | 2022-03-08 05:25:46 +0000 |
commit | 194b09fbc1edb2d0ccdadc53ec0893f61dbded8e (patch) | |
tree | 61e341c96647b254c24f59656d9856e606641707 /helix-core | |
parent | f31e85aca43dc7d1c5aa3e20add0f1126b112b0f (diff) |
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 <blaz@mxxn.io>
Diffstat (limited to 'helix-core')
-rw-r--r-- | helix-core/src/lib.rs | 12 | ||||
-rw-r--r-- | helix-core/src/syntax.rs | 2 |
2 files changed, 13 insertions, 1 deletions
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<String, std::io::Error> { +pub fn load_runtime_file(language: &str, filename: &str) -> Result<String, std::io::Error> { let path = crate::RUNTIME_DIR .join("queries") .join(language) |