Lookup files by resolved Path and not by fileName in sourcemapDecoder when querying program#25908
Merged
weswigham merged 2 commits intoJul 24, 2018
Conversation
… file as we intend
Path and not by fileName in sourcemapDecoder when querying program
weswigham
commented
Jul 24, 2018
| ts.zipWith(endMarkers, definitions, (endMarker, definition, i) => { | ||
| const marker = this.getMarkerByName(endMarker); | ||
| if (marker.fileName !== definition.fileName || marker.position !== definition.textSpan.start) { | ||
| if (ts.comparePaths(marker.fileName, definition.fileName, /*ignoreCase*/ true) !== ts.Comparison.EqualTo || marker.position !== definition.textSpan.start) { |
Member
Author
There was a problem hiding this comment.
I had to fix the fourslash harness to do case-appropriate comparisons of the paths returned in definition requests, since the fallback cache'd mapped locations are always canonicalized paths and not input-case-like strings (and the fourslash harness assumes case insensitivity).
mhegazy
approved these changes
Jul 24, 2018
Contributor
|
Please port to release-3.0 as well. |
weswigham
added a commit
to weswigham/TypeScript
that referenced
this pull request
Jul 24, 2018
…oder when querying program (microsoft#25908) * Check if the file returned by the program actually refers to the same file as we intend * Simplify
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.
Since each project has a different program, we were looking for a
Source.tswhich just so happened to also exist in the current program (different file, same name - ah, the folly of using a relative path as an identifier). Now we lookup using the fullpathinstead of the shorthandfileName.Fixes #25792 and I believe #25662