Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(extensions/#3238): VersionLens extension is not working on Windows #3248

Merged
merged 5 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES_CURRENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
- #3239 - Buffers: Fix filetype picker not working as expected without an active workspace
- #3240 - Formatting: Fix 'Invalid Range Specified' error (fixes #3014)
- #3241 - Extensions: Handle `maxCount` and FS errors in `vscode.workspace.findFiles` (related #3215)
- #3248 - Extension - Windows: Fix path normalization issue in document selector (fixes #3238)

### Performance

Expand Down
9 changes: 7 additions & 2 deletions src/Exthost/DocumentFilter.re
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ module CustomDecoders = {
string
|> and_then(str =>
try(
str |> Re.Glob.glob(~expand_braces=true) |> Re.compile |> succeed
str
|> Utility.Path.normalizeBackSlashes
|> Re.Glob.glob(~expand_braces=true)
|> Re.compile
|> succeed
) {
| exn => fail(Printexc.to_string(exn))
}
Expand Down Expand Up @@ -45,7 +49,8 @@ let matches = (~filetype: string, ~filepath: string, filter) => {
let patternMatches =
switch (filter.pattern) {
| None => true
| Some(glob) => Re.matches(glob, filepath) != []
| Some(glob) =>
Re.matches(glob, Utility.Path.normalizeBackSlashes(filepath)) != []
};

fileTypeMatches && patternMatches;
Expand Down