diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-01-18 15:57:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-18 15:57:30 -0500 |
commit | 35c1652f56f2a83380080b2c9942c595f80bd14d (patch) | |
tree | 4867dacfcbcbb01e7e1766d2fd8ce5e0a62ddf2b /cli/util/fs.rs | |
parent | 4e3aff8400fe1e6854a27687d14a07dc837c88d9 (diff) |
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
Diffstat (limited to 'cli/util/fs.rs')
-rw-r--r-- | cli/util/fs.rs | 12 |
1 files changed, 7 insertions, 5 deletions
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<TFilter: Fn(&Path, &FilePatterns) -> bool> FileCollector<TFilter> { 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!( "{}{}", |