Repository navigation
Avoid duplicate intrinsic method suggestions in tab completion - #28301
Open
Rudransh Shekhar (rudy-07) wants to merge 1 commit into
Open
Rudransh Shekhar (rudy-07) wants to merge 1 commit into
Rudransh Shekhar (rudy-07) wants to merge 1 commit into
Conversation
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
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Author
|
@microsoft-github-policy-service agree |
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.
PR Summary
Prevent
CompleteExtensionMethodsfrom 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 twoForEachentries. The second was the intrinsic method which cannot be invoked due to method resolution prioritizing the native member. This change checksresultsbefore adding intrinsic methods so duplicates are omitted while non-colliding methods (likePSForEach) continue to be completed.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headertest/powershell/Host/TabCompletion/BugFix.Tests.ps1