fix(loader): don't print warnings if the file is not found

(cherry picked from commit 18e4a2405b)
This commit is contained in:
Amaan Qureshi 2024-11-09 22:34:03 -05:00
parent 340d3eeb41
commit 2f6583aae2

View file

@ -1210,10 +1210,16 @@ impl Loader {
}
}
} else if let Err(e) = ts_json {
eprintln!(
"Warning: Failed to read {} -- {e}",
parser_path.join("tree-sitter.json").display()
);
match e.downcast_ref::<std::io::Error>() {
// This is noisy, and not really an issue.
Some(e) if e.kind() == std::io::ErrorKind::NotFound => {}
_ => {
eprintln!(
"Warning: Failed to parse {} -- {e}",
parser_path.join("tree-sitter.json").display()
);
}
}
}
// If we didn't find any language configurations in the tree-sitter.json file,