From 35c1652f56f2a83380080b2c9942c595f80bd14d Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 18 Jan 2024 15:57:30 -0500 Subject: fix(lsp): regression - formatting was broken on windows (#21972) ~~Waiting on: https://github.com/denoland/deno_config/pull/31~~ Closes #21971 Closes https://github.com/denoland/vscode_deno/issues/1029 --- cli/util/fs.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'cli/util') diff --git a/cli/util/fs.rs b/cli/util/fs.rs index b7832f2bb..bab36b31e 100644 --- a/cli/util/fs.rs +++ b/cli/util/fs.rs @@ -285,8 +285,8 @@ impl bool> FileCollector { let mut target_files = Vec::new(); let mut visited_paths = HashSet::new(); let file_patterns_by_base = file_patterns.split_by_base(); - for (base, file_patterns) in file_patterns_by_base { - let file = normalize_path(base); + for file_patterns in file_patterns_by_base { + let file = normalize_path(&file_patterns.base); // use an iterator in order to minimize the number of file system operations let mut iterator = WalkDir::new(&file) .follow_links(false) // the default, but be explicit @@ -807,9 +807,8 @@ mod tests { create_files(&ignore_dir_path, &ignore_dir_files); let file_patterns = FilePatterns { - include: Some(PathOrPatternSet::new(vec![PathOrPattern::Path( - root_dir_path.to_path_buf(), - )])), + base: root_dir_path.to_path_buf(), + include: None, exclude: PathOrPatternSet::new(vec![PathOrPattern::Path( ignore_dir_path.to_path_buf(), )]), @@ -871,6 +870,7 @@ mod tests { // test opting out of ignoring by specifying the dir let file_patterns = FilePatterns { + base: root_dir_path.to_path_buf(), include: Some(PathOrPatternSet::new(vec![ PathOrPattern::Path(root_dir_path.to_path_buf()), PathOrPattern::Path( @@ -948,6 +948,7 @@ mod tests { let result = collect_specifiers( FilePatterns { + base: root_dir_path.to_path_buf(), include: Some( PathOrPatternSet::from_relative_path_or_patterns( root_dir_path.as_path(), @@ -997,6 +998,7 @@ mod tests { }; let result = collect_specifiers( FilePatterns { + base: root_dir_path.to_path_buf(), include: Some(PathOrPatternSet::new(vec![PathOrPattern::new( &format!( "{}{}", -- cgit v1.2.3