Log failures to load tree-sitter parsers as error (#4315)
Info logs don't show up in the log file by default, but this line
should: failures to load tree-sitter parser objects are useful errors.
A parser might fail to load it is misconfigured
(https://github.com/helix-editor/helix/pull/4303#discussion_r996448543)
or if the file does not exist.
commit50b191a7dff4a6c311437d3e5fcd1ce36b300643
authorMichael Davis <mcarsondavis@gmail.com>
dateSun 16 Oct 2022, 14:59 (4 years ago)
parent5f4f171
helix-core/src/syntax.rs+7−1
@@ -368,7 +368,13 @@ impl LanguageConfiguration {
368368 None
369369 } else {
370370 let language = get_language(self.grammar.as_deref().unwrap_or(&self.language_id))
371− .map_err(|e| log::info!("{}", e))
371+ .map_err(|err| {
372+ log::error!(
373+ "Failed to load tree-sitter parser for language {:?}: {}",
374+ self.language_id,
375+ err
376+ )
377+ })
372378 .ok()?;
373379 let config = HighlightConfiguration::new(
374380 language,