Public API for partial events #77203
Labels
api-approved
API was approved in API review, it can be implemented
Area-Compilers
Concept-API
This issue involves adding, removing, clarification, or modification of an API.
Feature - Partial Events and Constructors
Feature Request
untriaged
Issues and PRs which have not yet been triaged by a lead
Background and Motivation
Test plan: #76859
Implementation: #77202
Equivalent API for partial properties: #73411
We need to introduce public APIs related to the upcoming partial events and constructors feature.
These APIs correspond to existing APIs on IMethodSymbol and IPropertySymbol, 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 events. No new APIs for constructors are needed because constructors implement IMethodSymbol.
Proposed API
Notable behaviors:
PartialImplementationPart
on it will return null.IMethodSymbol
. For example, if we had the definition part symbol forC.E.add
, and we accessedPartialImplementationPart
on it, we would get the implementation part symbol forC.E.add
. Also,IMethodSymbol.IsPartialDefinition
will return true for the definition part symbol forC.E.add
.Usage Examples
In
EventSymbolReferenceFinder
:Alternative Designs
Don't ship any new APIs and have users dig through the accessor symbols to locate the other property part instead. This seems cumbersome.
Risks
None.
The text was updated successfully, but these errors were encountered: