Strip glob patterns from include basePath #1004
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
quick explanation:
Absolute paths like
"/some/path/glob/**"were getting through when the correct path would be `"/some/path/glob"``long:
An include like
../../ambient-types/**/*is turned into an absolute path, let's say/home/dev/project/ambient-types/**/*and passed heretypescript-go/internal/vfs/utilities.go
Lines 241 to 252 in e8d352c
That strips the last chunk of the path, so returns
/home/dev/project/ambient-types/**. Thenpatternsintypescript-go/internal/vfs/utilities.go
Line 425 in e8d352c
/home/dev/project/ambient-types/**and that is not a valid path to visit intypescript-go/internal/vfs/utilities.go
Lines 370 to 382 in e8d352c
systemEntries.FilesandsystemEntries.Directoriesare empty and any files represented by that include are not found.Things do work with implicit globs, so if that include was
../../ambient-typesthebasePathends up as/home/dev/project/ambient-typesand the files and/or directories are found.This is attempting to address #980