Repository navigation
Deduplicate equivalent auto-import completions - #65826
Muhammad Faizan (MuhammadFaizan-prog) wants to merge 1 commit into
Conversation
|
Muhammad Faizan (@MuhammadFaizan-prog) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
|
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the change deduplicating equivalent auto-import completions.
No open issues 🎉
What changed in this PR
Addresses #65785 by deduplicating equivalent auto-import completions in the language service.
Changes:
- Keeps the first equivalent new-import suggestion while preserving distinct imports and displayed metadata.
- Adds Fourslash coverage for augmentations, aliases, packages, and named versus default imports.
| File | Description |
|---|---|
tsc/internal/ls/completions.go |
Deduplicates equivalent new-import completion items. |
tsc/internal/fourslash/tests/autoImportNonRelativeModuleAugmentation_test.go |
Adds regression tests and distinct-import controls. |
Review effort: Balanced
|
https://www.xtrend.pro/s/uE7RJb
💫👌🏻👌🏻👌🏻👌🏻
في سبت، ٥ ديسمبر، ٢٠٢٦ في ١٠:٥٤ م، كتب Copilot ***@***.***
…:
***@***.**** commented on this pull request.
🟢 Approval recommended
There are no active review issues for the change deduplicating equivalent
auto-import completions.
*No open issues* 🎉
*What changed in this PR*
Addresses #65785 <#65785>
by deduplicating equivalent auto-import completions in the language service.
*Changes:*
- Keeps the first equivalent new-import suggestion while preserving
distinct imports and displayed metadata.
- Adds Fourslash coverage for augmentations, aliases, packages, and
named versus default imports.
File Description
tsc/internal/ls/completions.go Deduplicates equivalent new-import
completion items.
tsc/internal/fourslash/tests/autoImportNonRelativeModuleAugmentation_test.go Adds
regression tests and distinct-import controls.
Review effort: Balanced
—
Reply to this email directly, view it on GitHub
<#65826?email_source=notifications&email_token=CU4OSVJNNIXI6KRVF64MJ3T54RRXLA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTMMRQGU2TMNBTGI22M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#pullrequestreview-6205564325>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CU4OSVOAEOKB5E2NKSL3EPT54RRXLAVCNFSNUABEKJSXA33TNF2G64TZHMZDAOJSHEYDENJ3JFZXG5LFHM3DQMJWG4YTQNRSGKQXMAQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Fixes #65785.
A non-relative module augmentation and the original module can be indexed separately and produce two completion items that insert the same import. Keep the first equivalent new-import item while preserving distinct module specifiers, import kinds, and displayed metadata.
The new Fourslash tests fail on the unpatched compiler and pass with the change. They cover ordinary and import-statement completions, path aliases, installed packages, and the relative-augmentation control. A separate test verifies that both named and default imports from the same module still appear. Independent native LSP checks also compared exact insertion text and ranges. Scoped formatting and diff checks passed.