Confirm TypeScript PR #60238 fix is already correctly implemented #1140
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.
This PR investigates and confirms that the changes from TypeScript PR #60238 "Fix prioritization of
paths
specifiers over node_modules package specifiers" have already been correctly ported to the Go codebase.Investigation Summary
TypeScript PR #60238 fixed an issue where
paths
specifiers fromtsconfig.json
were not being properly prioritized over node_modules package specifiers during module resolution. The key change was:Before the fix:
After the fix:
Findings
Analysis of the Go codebase shows this fix was already correctly implemented in
internal/modulespecifiers/specifiers.go
:getLocalModuleSpecifier
is NOT conditional on!specifier
(already moved outside any conditional block)pathsOnly
parameter correctly usesmodulePath.IsRedirect || len(specifier) > 0
(equivalent to the TypeScript fix)Verification
TestPathsPriorityOverNodeModules
to document and verify the fix_submodules/TypeScript/tests/cases/fourslash/autoImportPathsNodeModules.ts
Conclusion
No code changes were needed as the fix from TypeScript PR #60238 has already been correctly ported to the Go implementation. This PR adds a test to document that the fix is in place and closes the issue.
Fixes #1127.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.