Fix incorrect use of "path" instead of "resolvedPath" when watching file's package json locations#57931
Fix incorrect use of "path" instead of "resolvedPath" when watching file's package json locations#57931sheetalkamat merged 2 commits intomainfrom
Conversation
…ile's package json lookup locations
andrewbranch
left a comment
There was a problem hiding this comment.
Thank you! So let me see if I understand this correctly. In the failing test case, a referenced project’s output declaration file gets renamed due to a tsconfig edit, while the input source file keeps the same name. The source file’s path was the path to the input file and did not change during this edit, but its resolvedPath was the path to the declaration file and did change. So when the test was failing, existing had a length of 5, containing all the package.json locations looked up for the old declaration file name. After your change, existing is emptyArray, causing all the watched locations for the new declaration file name to be updated or created.
|
Seems correct to me; the string is just a map key so its value doesn't seem to matter for other resolution stuff (which seems good). |
|
@andrewbranch exactly what you said.. we were incorrectly using "index.ts" as the location and thats not where the lookups happen so we were incorrectly deciding its just update with last element instead of new locations to watch. |
Fixes issue found at #57757