Fix auto-import barrel ranking for path-prefix collisions - #64107
Merged
Andrew Branch (andrewbranch) merged 2 commits intoAug 31, 2026
Conversation
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix auto-import behavior with barrel files and prefix names
Fix auto-import barrel ranking for path-prefix collisions
Aug 31, 2026
Andrew Branch (andrewbranch)
approved these changes
Aug 31, 2026
Andrew Branch (andrewbranch)
marked this pull request as ready for review
August 31, 2026 16:30
Andrew Branch (andrewbranch)
enabled auto-merge
August 31, 2026 16:30
Copilot started reviewing on behalf of
Andrew Branch (andrewbranch)
August 31, 2026 16:32
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes auto-import barrel ranking when a directory name prefixes the importing filename.
Changes:
- Requires a directory boundary in the cycle heuristic.
- Adds NodeNext ESM regression coverage for ordering.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tsc/internal/ls/autoimport/fix.go |
Corrects directory containment detection. |
tsc/internal/fourslash/tests/autoImportIndexReExportPrefix_test.go |
Verifies barrel and direct import ordering. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Ryan Cavanaugh (RyanCavanaugh)
approved these changes
Aug 31, 2026
Andrew Branch (andrewbranch)
deleted the
copilot/fix-auto-import-ignores-barrel
branch
August 31, 2026 17:05
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Auto-import incorrectly penalized an index barrel when its directory name was a textual prefix of the importing file name:
sumAB.tsas contained bysum/.