Skip to content

Commit

Permalink
feat(breeze.rs): make parse_files take in a number of jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed May 6, 2023
1 parent defd3f1 commit db2c87c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/breeze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ fn parse_file(filepath: &std::path::PathBuf, parser: &mut Parser) -> Result<Tree
pub fn parse_files(
files: Vec<PathBuf>,
language: Language,
num_jobs: Option<usize>,
callback: &'static (dyn Fn(Tree) + Send + Sync),
) {
let threadpool = Builder::new()
.thread_name("neorg".into())
.num_threads(8)
.num_threads(num_jobs.unwrap_or(4))
.build();

for file in files {
Expand Down Expand Up @@ -75,6 +76,7 @@ mod tests {
parse_files(
workspace.files(),
tree_sitter_norg::language(),
None,
&|tree: Tree| assert!(tree.root_node().kind() == "document"),
);
}
Expand Down

0 comments on commit db2c87c

Please sign in to comment.