on master help sign in
only fetch git-sourced grammars
6fcab90Michael Davis
helix-loader/src/grammar.rs+7−6
@@ -76,7 +76,11 @@ pub fn get_language(name: &str) -> Result<Language> {
76}
76}
77
77
78pub fn fetch_grammars() -> Result<()> {
78pub fn fetch_grammars() -> Result<()> {
79+ // We do not need to fetch local grammars.
79− run_parallel(get_grammar_configs()?, fetch_grammar, "fetch")
80+ let mut grammars = get_grammar_configs()?;
81+ grammars.retain(|grammar| !matches!(grammar.source, GrammarSource::Local { .. }));
82+
83+ run_parallel(grammars, fetch_grammar, "fetch")
80}
84}
81
85
82pub fn build_grammars() -> Result<()> {
86pub fn build_grammars() -> Result<()> {
@@ -172,15 +176,12 @@ fn fetch_grammar(grammar: GrammarConfiguration) -> Result<()> {
172 "Grammar '{}' checked out at '{}'.",
176 "Grammar '{}' checked out at '{}'.",
173 grammar.grammar_id, revision
177 grammar.grammar_id, revision
174 );
178 );
175− Ok(())
176 } else {
179 } else {
177 println!("Grammar '{}' is already up to date.", grammar.grammar_id);
180 println!("Grammar '{}' is already up to date.", grammar.grammar_id);
178− Ok(())
179 }
181 }
180− } else {
181− println!("Skipping local grammar '{}'", grammar.grammar_id);
182− Ok(())
183 }
182 }
183+
184+ Ok(())
184}
185}
185
186
186// Sets the remote for a repository to the given URL, creating the remote if
187// Sets the remote for a repository to the given URL, creating the remote if