-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Address a few locations also need to care about partial properties #73792
Address a few locations also need to care about partial properties #73792
Conversation
@@ -164,6 +164,34 @@ public partial class C1 | |||
Assert.Equal(implementation, ResolveSymbol(implementation, comp, SymbolKeyComparison.None)); | |||
} | |||
|
|||
[Fact] | |||
public void ExtendedPartialPropertyDefinitionAndImplementationResolveCorrectly() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a test verified the same behavior as partial methods above.
@@ -73,18 +73,27 @@ public CSharpNavigationBarItemService() | |||
continue; | |||
} | |||
|
|||
var method = member as IMethodSymbol; | |||
if (method != null && method.PartialImplementationPart != null) | |||
if (member is IMethodSymbol { PartialImplementationPart: { } } methodSymbol) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @tmat to take a look. Not familiar with debugger, but I feel this change brings no harm.
8b6bdf2
into
dotnet:features/partial-properties
Address part of this #73772
So in the IDE part:
This PR add the handling for partial properties for:
roslyn/src/EditorFeatures/CSharpTest/SymbolKey/SymbolKeyCompilationsTests.cs
roslyn/src/Features/Core/Portable/Debugging/AbstractBreakpointResolver.cs
roslyn/src/Features/CSharp/Portable/NavigationBar/CSharpNavigationBarItemService.cs