Skip to content

Commit

Permalink
tree-sitter: Prevent panic on loading queries
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis authored and archseer committed Aug 31, 2022
1 parent 4c789cf commit fa1dc7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helix-core/src/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit fa1dc7e

Please sign in to comment.