⚡ Sangsakala Proxy 🏠 Home
Skip to content

Avoid duplicate intrinsic method suggestions in tab completion - #28301

Open
Rudransh Shekhar (rudy-07) wants to merge 1 commit into
PowerShell:masterfrom
rudy-07:fix-tab-completion-duplication-intrinsic
Open

Rudransh Shekhar (rudy-07) wants to merge 1 commit into
PowerShell:masterfrom
rudy-07:fix-tab-completion-duplication-intrinsic

Conversation

@rudy-07

Copy link
Copy Markdown

PR Summary

Prevent CompleteExtensionMethods from appending intrinsic collection methods (ForEach, Where, PSForEach, PSWhere) when a type-native member with that name already exists in the completion candidate list.

PR Context

Fix #24729

When completing members on objects defining native methods like List<T>.ForEach(Action<T>), tab completion returned two ForEach entries. The second was the intrinsic method which cannot be invoked due to method resolution prioritizing the native member. This change checks results before adding intrinsic methods so duplicates are omitted while non-colliding methods (like PSForEach) continue to be completed.

PR Checklist

Prevent CompleteExtensionMethods from appending intrinsic collection methods when a type-native member with the same name already exists in the completion candidate list.

Fix PowerShell#24729
Copilot AI balanced review requested due to automatic review settings November 2, 2026 20:40
@rudy-07
Rudransh Shekhar (rudy-07) requested a review from a team as a code owner November 2, 2026 20:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@rudy-07

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tab completion unexpectedly returns intrinsic methods for objects with a type-native ForEach()/Where()

2 participants