tree-sitter: Prevent panic on loading queries

This commit is contained in:
Michael Davis 2022-08-25 13:10:33 -05:00 committed by Blaž Hrastnik
parent 4c789cfbda
commit fa1dc7e508

View file

@ -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))