Skip to content

Show both property and extension method items with identical name#82315

Merged
genlu merged 3 commits intodotnet:mainfrom
genlu:FixExtensionItem
Feb 10, 2026
Merged

Show both property and extension method items with identical name#82315
genlu merged 3 commits intodotnet:mainfrom
genlu:FixExtensionItem

Conversation

@genlu
Copy link
Member

@genlu genlu commented Feb 6, 2026

Also for method + extension property.
Fix #70537

@genlu genlu requested a review from a team as a code owner February 6, 2026 06:12
…completion list

Also for method + extension property.
item = item.AddTag(WellKnownTags.TargetTypeMatch);
}
var includeItemInTargetTypedCompletion = false;
var arbitraryFirstContext = contextLookup(symbolList[0]);
Copy link
Member

Choose a reason for hiding this comment

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

I know this code is preexisting, it is just odd to me to grab the first list item when we might reorder the list a few lines later. Perhaps a comment could be added explaining why the context is truly arbitrary.

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm, I'm actually not sure about this. Need to take a closer look to understand how it supposed to work with linked docs.🤔

completionContext, symbolGroup.Key.displayText, symbolGroup.Key.suffix, symbolGroup.Key.insertionText, symbolList, arbitraryFirstContext, supportedPlatformData);

if (includeItemInTargetTypedCompletion)
void CreateAndAddItem(ImmutableArray<SymbolAndSelectionInfo> symbolList, bool doNotMerge)
Copy link
Contributor

Choose a reason for hiding this comment

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

ImmutableArray

Could this be something like OneOrMany instead to avoid needing to allocate the array in the common case?

Copy link
Contributor

Choose a reason for hiding this comment

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

never mind, it wouldn't be simple. It looks like CreateItem takes in that collection and has several overrides that would need changing

Copy link
Member Author

@genlu genlu Feb 10, 2026

Choose a reason for hiding this comment

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

Yea, it'd ended up touching a lot more code than I intended in this fix.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Completion doesn't show extension methods if there is a property with the same name

4 participants