Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge partial properties feature to main #73815

Merged
merged 22 commits into from
May 31, 2024
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c3f13e3
Partial properties: merging declarations and emit of simple cases (#7…
RikkiGibson May 1, 2024
176000a
Partial properties: diagnostics for mismatch between parts (#73250)
RikkiGibson May 7, 2024
8fbce08
Merge remote-tracking branch 'upstream/main' into partial-properties-…
RikkiGibson May 7, 2024
3d0fbf6
Fix merge conflict
RikkiGibson May 7, 2024
d324662
Update error code names
RikkiGibson May 7, 2024
14a1ed7
Merge pull request #73377 from RikkiGibson/partial-properties-3-merge…
RikkiGibson May 8, 2024
2722d74
Partial properties: basic indexer scenarios and signature mismatch di…
RikkiGibson May 11, 2024
28c886c
Partial properties: attributes (#73437)
RikkiGibson May 16, 2024
6216958
Merge remote-tracking branch 'upstream/main' into partial-properties-…
RikkiGibson May 16, 2024
616fd3c
Merge pull request #73522 from RikkiGibson/partial-properties-6-merge…
RikkiGibson May 17, 2024
ee47efe
Partial properties: misc compiler layer work (#73527)
RikkiGibson May 20, 2024
6ccd0ec
Partial properties: public API and IDE features (#73603)
RikkiGibson May 29, 2024
73f258c
Merge remote-tracking branch 'upstream/main' into partial-properties-9
RikkiGibson May 29, 2024
05ece7d
Resolve conflicts
RikkiGibson May 29, 2024
4793dce
Merge pull request #73774 from RikkiGibson/partial-properties-9
RikkiGibson May 30, 2024
7449c8c
Add a symbol verification test
Cosifne May 30, 2024
fd83234
Also check the property partial impl
Cosifne May 30, 2024
7256773
Check partial property in nav bar servivce
Cosifne May 30, 2024
dc70302
Refactor the code
Cosifne May 30, 2024
8b6bdf2
Merge pull request #73792 from Cosifne/dev/shech/HandlePartialProperires
Cosifne May 31, 2024
b61f0e4
Prepare partial properties feature for merge (#73773)
RikkiGibson May 31, 2024
13fd9e2
Merge remote-tracking branch 'upstream/main' into partial-properties-…
RikkiGibson May 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Also check the property partial impl
Cosifne committed May 30, 2024
commit fd83234d0864894a2071ac7e5d7c40ded5d8294b
Original file line number Diff line number Diff line change
@@ -211,7 +211,7 @@ private IEnumerable<ISymbol> FindMembers(IEnumerable<INamespaceOrTypeSymbol> con
private IEnumerable<ISymbol> FindMembers(IEnumerable<INamedTypeSymbol> types, NameAndArity nameAndArity)
{
// Get the matching members from all types (including constructors and explicit interface
// implementations). If there is a partial method, prefer returning the implementation over
// implementations). If there is a partial method/property, prefer returning the implementation over
// the definition (since the definition will not be a candidate for setting a breakpoint).
var members = types.SelectMany(t => GetMembers(t, nameAndArity.Name))
.Select(s => GetPartialImplementationPartOrNull(s) ?? s);
@@ -227,8 +227,12 @@ private async Task<IEnumerable<INamedTypeSymbol>> GetAllTypesAsync(CancellationT
return namespaces.GetAllTypes(cancellationToken);
}

private static IMethodSymbol GetPartialImplementationPartOrNull(ISymbol symbol)
=> (symbol.Kind == SymbolKind.Method) ? ((IMethodSymbol)symbol).PartialImplementationPart : null;
private static ISymbol GetPartialImplementationPartOrNull(ISymbol symbol) => symbol.Kind switch
{
SymbolKind.Method => ((IMethodSymbol)symbol).PartialImplementationPart,
SymbolKind.Property => ((IPropertySymbol)symbol).PartialImplementationPart,
_ => null
};

/// <summary>
/// Is this method or property a valid place to set a breakpoint and does it match the expected parameter count?