Stop trying to de-duplicate completion results#3897
Stop trying to de-duplicate completion results#3897daxian-dbw merged 1 commit intoPowerShell:masterfrom
Conversation
|
I noticed on the latest master branch that I am ending up with a lot of duplicates in a particular scenario. Specifically, when I try to tab complete a function from a module that has not been imported yet. An easy reproducible example is to type I am not sure if it's related to this particular commit or not, but it seems suspicious. On 2.3.5 I don't have this bug. Should I raise a separate issue on this topic? |
|
@blaisemGH Can you check if those duplicate results are also present when using intellisense in VSCode editor? |
@daxian-dbw Yes, the duplicates are also there in the latest version: PowerShellGet has not been imported, so its exported functions seem to be duplicated. The extension terminal is running PS7.4.2 |
|
Actually I just tested it again, and I seem to have made a mistake with my earlier statement that it began with 2.4.0. The issue existed already in PSReadLine 2.3.5: However, it seems to have not existed in PSReadLine 2.3.4:
|
|
@daxian-dbw Ok I just cloned the github tag v2.3.5, and tried building it with and without the changes in this commit. The duplicates are removed with the deduplication logic; with this commit's changes (removing the deduplication logic), the duplicates are present. So I guess the code removed in this commit was covering up the duplicates. |
|
I have a fix for this in the tab completion code here: PowerShell/PowerShell#21113 though that obviously won't help older PS versions. |
|
Oh nice. I was digging through the tabexpansion2 source too, but glad to know there's already a PR on it. Also on my machine, it does seem to be caused by multiple available module versions and each being prepended with the module name. I didn't know the deduplication code in PSReadLine was causing issues, but at any rate, even without that I can understand why this is the wrong place to resolve an upstream error. Thanks for the feedback here. |
|
Yeah, the deduplication was problematic and the reason to remove it is to get consistency as in VSCode editor (not terminal) and ISE. @MartinGC94 Thanks for the PR! I will make sure review it (and maybe merge it :)) on Monday. |
|
@daxian-dbw Any idea on when PSReadLine 2.4.2 will be released properly (and included in PS7)? Today I tried completing |



PR Summary
Fix #3896
Given that both ISE and VSCode editor completion doesn't de-duplicate completion results, we probably should stop trying to de-duplicate completion results in PSReadLine to be consistent.
PR Checklist
Microsoft Reviewers: Open in CodeFlow