Fix Windows-style absolute paths in triple-slash directives#21205
Merged
uniqueiniquity merged 4 commits intoJan 17, 2018
Merged
Conversation
mhegazy
approved these changes
Jan 17, 2018
mhegazy
approved these changes
Jan 17, 2018
Contributor
|
You also mentioned another test for tsconfig paths, we should add that as well. |
Contributor
|
thanks! |
Member
|
Instead of doing this shouldn't we be looking for usage of getRootLength to ensure it always passes paths that have normalized slashes ? |
Contributor
Author
|
@sheetalkamat I discussed this with @mhegazy. We agreed that would definitely be a better approach but that it made sense to make this change to get back to the behavior we had before #19702. I've started looking into what you suggested and it quickly became unclear; for example, we use the Path type to represent normalized paths, but the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
PR #19702 caused Windows-style absolute paths to be no longer understood as absolute paths.
This change appropriately normalizes paths in triple-slash directives so that they can be recognized correctly.
EDIT: This change now checks for backslashes in file paths to determine if a path is rooted. This was updated to cover more cases than just triple-slash directives.