Public API for partial properties #73411
Labels
api-approved
API was approved in API review, it can be implemented
Concept-API
This issue involves adding, removing, clarification, or modification of an API.
Feature Request
Background and Motivation
Test plan: #73090
We need to introduce public APIs related to the upcoming partial properties feature.
These APIs generally correspond to existing APIs on
IMethodSymbol
, which are used for key IDE features such as go-to-definition and find-all-references. We expect these APIs to be used by the same features for corresponding scenarios relating to properties.Proposed API
Notable behaviors:
PartialImplementationPart
on it will return null.IMethodSymbol
. For example, if we had the definition part symbol forC.Prop.get
, and we accessedPartialImplementationPart
on it, we would get the implementation part symbol forC.Prop.get
. Also,IMethodSymbol.IsPartialDefinition
will returntrue
for the definition part symbol forC.Prop.get
.Usage Examples
The following is based on the existing helper ParameterSymbolReferenceFinder.CascadeBetweenPartialMethodParameters:
Alternative Designs
public bool IPropertySymbol.IsPartialDefinition { get; }
for uniformity with existingIMethodSymbol.IsPartialDefinition
.The reason this API is not included in the main proposal because partial properties are required to have an implementation part. IMethodSymbol.IsPartialDefinition was introduced to address EnC scenarios around partial methods lacking an implementation part. But perhaps no such scenario exists for partial properties, since a compilation error occurs when the property lacks an implementation part.
Risks
N/A
The text was updated successfully, but these errors were encountered: