Skip to content

Commit

Permalink
Log failures to load tree-sitter parsers as error
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
(#4303 (comment))
or if the file does not exist.
  • Loading branch information
the-mikedavis committed Oct 16, 2022
1 parent 2457111 commit b99f6bf
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 b99f6bf

Please sign in to comment.