Skip to content

Commit

Permalink
Log failures to load tree-sitter parsers as error (helix-editor#4315)
Browse files Browse the repository at this point in the history
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
(helix-editor#4303 (comment))
or if the file does not exist.
  • Loading branch information
the-mikedavis authored and Shekhinah Memmel committed Dec 11, 2022
1 parent 1519ab6 commit 8defc30
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion helix-core/src/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,13 @@ impl LanguageConfiguration {
None
} else {
let language = get_language(self.grammar.as_deref().unwrap_or(&self.language_id))
.map_err(|e| log::info!("{}", e))
.map_err(|err| {
log::error!(
"Failed to load tree-sitter parser for language {:?}: {}",
self.language_id,
err
)
})
.ok()?;
let config = HighlightConfiguration::new(
language,
Expand Down

0 comments on commit 8defc30

Please sign in to comment.