From f0d49d3ca4535a8c22a4ca4038e889560723ec74 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Wed, 7 Apr 2021 18:05:59 +0900 Subject: hack: make queries load relative to source dir for now. We want to provide a runtime dir later on. --- helix-core/src/syntax.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'helix-core') diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 6d6fe648..e108d030 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -65,12 +65,14 @@ impl LanguageConfiguration { .get_or_init(|| { // let name = get_language_name(&self.language_id); + let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + let highlights_query = - std::fs::read_to_string(self.path.join("queries/highlights.scm")) + std::fs::read_to_string(root.join(&self.path).join("queries/highlights.scm")) .unwrap_or_default(); let injections_query = - std::fs::read_to_string(self.path.join("queries/injections.scm")) + std::fs::read_to_string(root.join(&self.path).join("queries/injections.scm")) .unwrap_or_default(); let locals_query = ""; -- cgit v1.2.3-70-g09d2