Fix bugs in module specifier generation with paths/typesVersions#49792
Fix bugs in module specifier generation with paths/typesVersions#49792andrewbranch merged 6 commits intomicrosoft:mainfrom
paths/typesVersions#49792Conversation
|
@typescript-bot perf test this |
|
Heya @andrewbranch, I've started to run the perf test suite on this PR at 45f4adc. You can monitor the build here. Update: The results are in! |
|
@andrewbranch Here they are:
CompilerComparison Report - main..49792
System
Hosts
Scenarios
TSServerComparison Report - main..49792
System
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| validateEnding({ ending, value }) | ||
| ) { | ||
| const matchedStar = value.substring(prefix.length, value.length - suffix.length); | ||
| return key.replace("*", matchedStar); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding
| // importNameCodeFix_typesVersions.ts for an example.) | ||
| const mainExportFile = toPath(mainFileRelative, packageRootPath, getCanonicalFileName); | ||
| if (removeFileExtension(mainExportFile) === removeFileExtension(getCanonicalFileName(moduleFileToTry))) { | ||
| // ^ An arbitrary removal of file extension for this comparison is almost certainly wrong |
There was a problem hiding this comment.
Is this intended to be a TODO?
There was a problem hiding this comment.
More of a hint for a future developer investigating bugs in this area—a TODO only if prompted by a user report.
|
|
||
| // Simplify the full file path to something that can be resolved by Node. | ||
|
|
||
| const preferences = getPreferences(host, userPreferences, options, importingSourceFile); |
There was a problem hiding this comment.
Is this used outside the if block, or is it so cheap that it just doesn't matter where it is?
There was a problem hiding this comment.
I assume I had a reason to move it; maybe refactored away in later edits, but it is trivially cheap.
|
Thanks for the review! I forgot this was the one with the big table. Writing that out actually helped my clarify my mental model of module specifier generation a lot, which was a topic I thought I already understood well. |
This was much more difficult to do correctly than I expected, but it fixes more than what I set out to fix.
Fixes #49034
Fixes #49290