Skip to content

Commit

Permalink
Add public API
Browse files Browse the repository at this point in the history
  • Loading branch information
RikkiGibson committed May 20, 2024
1 parent ee47efe commit b801092
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ ImmutableArray<CustomModifier> IPropertySymbol.RefCustomModifiers

RefKind IPropertySymbol.RefKind => _underlying.RefKind;

#nullable enable
IPropertySymbol? IPropertySymbol.PartialDefinitionPart => (_underlying as SourcePropertySymbol)?.PartialDefinitionPart.GetPublicSymbol();

IPropertySymbol? IPropertySymbol.PartialImplementationPart => (_underlying as SourcePropertySymbol)?.PartialImplementationPart.GetPublicSymbol();
#nullable disable

#region ISymbol Members

protected override void Accept(SymbolVisitor visitor)
Expand Down
2 changes: 2 additions & 0 deletions src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Microsoft.CodeAnalysis.IParameterSymbol.IsParamsCollection.get -> bool
Microsoft.CodeAnalysis.IParameterSymbol.IsParamsArray.get -> bool
Microsoft.CodeAnalysis.IPropertySymbol.PartialDefinitionPart.get -> Microsoft.CodeAnalysis.IPropertySymbol?
Microsoft.CodeAnalysis.IPropertySymbol.PartialImplementationPart.get -> Microsoft.CodeAnalysis.IMethodSymbol?

Check failure on line 4 in src/Compilers/Core/Portable/PublicAPI.Unshipped.txt

View check run for this annotation

Azure Pipelines / roslyn-CI (Correctness Correctness_Analyzers)

src/Compilers/Core/Portable/PublicAPI.Unshipped.txt#L4

src/Compilers/Core/Portable/PublicAPI.Unshipped.txt(4,1): error RS0017: (NETCORE_ENGINEERING_TELEMETRY=Build) Symbol 'Microsoft.CodeAnalysis.IPropertySymbol.PartialImplementationPart.get -> Microsoft.CodeAnalysis.IMethodSymbol?' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md)

Check failure on line 4 in src/Compilers/Core/Portable/PublicAPI.Unshipped.txt

View check run for this annotation

Azure Pipelines / roslyn-CI (Correctness Correctness_Analyzers)

src/Compilers/Core/Portable/PublicAPI.Unshipped.txt#L4

src/Compilers/Core/Portable/PublicAPI.Unshipped.txt(4,1): error RS0017: (NETCORE_ENGINEERING_TELEMETRY=Build) Symbol 'Microsoft.CodeAnalysis.IPropertySymbol.PartialImplementationPart.get -> Microsoft.CodeAnalysis.IMethodSymbol?' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md)
Microsoft.CodeAnalysis.Operations.ArgumentKind.ParamCollection = 4 -> Microsoft.CodeAnalysis.Operations.ArgumentKind
Microsoft.CodeAnalysis.Diagnostics.SuppressionInfo.ProgrammaticSuppressions.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.Suppression>
Microsoft.CodeAnalysis.Emit.InstrumentationKind.ModuleCancellation = 3 -> Microsoft.CodeAnalysis.Emit.InstrumentationKind
Expand Down
12 changes: 12 additions & 0 deletions src/Compilers/Core/Portable/Symbols/IPropertySymbol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,17 @@ public interface IPropertySymbol : ISymbol
/// The list of custom modifiers, if any, associated with the type of the property.
/// </summary>
ImmutableArray<CustomModifier> TypeCustomModifiers { get; }

/// <summary>
/// If this is a partial property implementation part, returns the corresponding
/// definition part. Otherwise null.
/// </summary>
IPropertySymbol? PartialDefinitionPart { get; }

/// <summary>
/// If this is a partial property definition part, returns the corresponding
/// implementation part. Otherwise null.
/// </summary>
IPropertySymbol? PartialImplementationPart { get; }

Check failure on line 124 in src/Compilers/Core/Portable/Symbols/IPropertySymbol.cs

View check run for this annotation

Azure Pipelines / roslyn-CI (Correctness Correctness_Analyzers)

src/Compilers/Core/Portable/Symbols/IPropertySymbol.cs#L124

src/Compilers/Core/Portable/Symbols/IPropertySymbol.cs(124,54): error RS0016: (NETCORE_ENGINEERING_TELEMETRY=Build) Symbol 'Microsoft.CodeAnalysis.IPropertySymbol.PartialImplementationPart.get -> Microsoft.CodeAnalysis.IPropertySymbol?' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md)

Check failure on line 124 in src/Compilers/Core/Portable/Symbols/IPropertySymbol.cs

View check run for this annotation

Azure Pipelines / roslyn-CI (Correctness Correctness_Analyzers)

src/Compilers/Core/Portable/Symbols/IPropertySymbol.cs#L124

src/Compilers/Core/Portable/Symbols/IPropertySymbol.cs(124,54): error RS0016: (NETCORE_ENGINEERING_TELEMETRY=Build) Symbol 'Microsoft.CodeAnalysis.IPropertySymbol.PartialImplementationPart.get -> Microsoft.CodeAnalysis.IPropertySymbol?' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md)

Check failure on line 124 in src/Compilers/Core/Portable/Symbols/IPropertySymbol.cs

View check run for this annotation

Azure Pipelines / roslyn-CI (Correctness Correctness_Analyzers)

src/Compilers/Core/Portable/Symbols/IPropertySymbol.cs#L124

src/Compilers/Core/Portable/Symbols/IPropertySymbol.cs(124,54): error RS0016: (NETCORE_ENGINEERING_TELEMETRY=Build) Symbol 'Microsoft.CodeAnalysis.IPropertySymbol.PartialImplementationPart.get -> Microsoft.CodeAnalysis.IPropertySymbol?' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md)
}
}
14 changes: 14 additions & 0 deletions src/Compilers/VisualBasic/Portable/Symbols/PropertySymbol.vb
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,20 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End Get
End Property

Private ReadOnly Property IPropertySymbol_PartialDefinitionPart As IPropertySymbol Implements IPropertySymbol.PartialDefinitionPart
Get
' Feature not supported in VB
Return Nothing
End Get
End Property

Private ReadOnly Property IPropertySymbol_PartialImplementationPart As IPropertySymbol Implements IPropertySymbol.PartialImplementationPart
Get
' Feature not supported in VB
Return Nothing
End Get
End Property

Public Overrides Sub Accept(visitor As SymbolVisitor)
visitor.VisitProperty(Me)
End Sub
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,9 @@ public ImmutableArray<IPropertySymbol> ExplicitInterfaceImplementations
return this;
}
}

public IPropertySymbol PartialDefinitionPart => _symbol.PartialDefinitionPart;

public IPropertySymbol PartialImplementationPart => _symbol.PartialImplementationPart;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,8 @@ public override TResult Accept<TArgument, TResult>(SymbolVisitor<TArgument, TRes
public ImmutableArray<CustomModifier> RefCustomModifiers => [];

public ImmutableArray<CustomModifier> TypeCustomModifiers => [];

public IPropertySymbol PartialImplementationPart => null;

public IPropertySymbol PartialDefinitionPart => null;
}

0 comments on commit b801092

Please sign in to comment.