diff options
author | Michael Davis | 2022-08-25 18:10:33 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2022-08-31 08:45:23 +0000 |
commit | fa1dc7e5086e598eb04a34407d8c09e5605b3760 (patch) | |
tree | 9e57e51fbc759246b9271d20184ca0c5cda0c564 /helix-core | |
parent | 4c789cfbda5cd0e6a6319fd3dafff8020529b762 (diff) |
tree-sitter: Prevent panic on loading queries
Diffstat (limited to 'helix-core')
-rw-r--r-- | helix-core/src/syntax.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 7ce0f8d2..06e9cbc0 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -374,7 +374,8 @@ impl LanguageConfiguration { &injections_query, &locals_query, ) - .unwrap_or_else(|query_error| panic!("Could not parse queries for language {:?}. Are your grammars out of sync? Try running 'hx --grammar fetch' and 'hx --grammar build'. This query could not be parsed: {:?}", self.language_id, query_error)); + .map_err(|err| log::error!("Could not parse queries for language {:?}. Are your grammars out of sync? Try running 'hx --grammar fetch' and 'hx --grammar build'. This query could not be parsed: {:?}", self.language_id, err)) + .ok()?; config.configure(scopes); Some(Arc::new(config)) |