cli: Missing config file shouldn't be an error

Just fall back on the default values for each configuration option.
This commit is contained in:
Douglas Creager 2021-06-10 09:43:07 -04:00
parent e841fcfa1b
commit b44270efab
3 changed files with 22 additions and 11 deletions

View file

@ -104,6 +104,13 @@ impl Loader {
}
pub fn find_all_languages(&mut self, config: &Config) -> Result<()> {
if config.parser_directories.is_empty() {
eprintln!("Warning: You have not configured any parser directories!");
eprintln!("Please run `tree-sitter init-config` and edit the resulting");
eprintln!("configuration file to indicate where we should look for");
eprintln!("language grammars.");
eprintln!("");
}
for parser_container_dir in &config.parser_directories {
if let Ok(entries) = fs::read_dir(parser_container_dir) {
for entry in entries {