Skip to content

Commit

Permalink
Updated some summaries
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Menegazzo <manuel.menegazzo@outlook.com>
  • Loading branch information
m3nax committed Sep 3, 2024
1 parent 873ae3f commit 53964b4
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 28 deletions.
13 changes: 6 additions & 7 deletions src/Dapr.Actors.Generators/ActorClientGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
/// <summary>
/// Returns the descriptor for the actor client to generate.
/// </summary>
/// <param name="context"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
/// <param name="context">Current generator syntax context passed from generator pipeline.</param>
/// <param name="cancellationToken">Cancellation token used to interrupt the generation.</param>
/// <returns>Returns the descriptor of actor client to generate.</returns>
static ActorClientDescriptor CreateActorClientDescriptor(
GeneratorAttributeSyntaxContext context,
CancellationToken cancellationToken)
Expand Down Expand Up @@ -100,9 +99,9 @@ static ActorClientDescriptor CreateActorClientDescriptor(
/// <summary>
/// Generates the actor client code based on the specified descriptor.
/// </summary>
/// <param name="context"></param>
/// <param name="descriptor"></param>
/// <exception cref="InvalidOperationException"></exception>
/// <param name="context">Context passed from the source generator when it has registered an output.</param>
/// <param name="descriptor">Descriptor of actor client to generate.</param>
/// <exception cref="InvalidOperationException">Throws when assembly doesn't one or more required symbols.</exception>
static void GenerateActorClientCode(SourceProductionContext context, ActorClientDescriptor descriptor)
{
try
Expand Down
12 changes: 11 additions & 1 deletion src/Dapr.Actors.Generators/DiagnosticsException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@

namespace Dapr.Actors.Generators
{
/// <summary>
/// Exception thrown when diagnostics are encountered during code generation.
/// </summary>
internal sealed class DiagnosticsException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="DiagnosticsException"/> class.
/// </summary>
/// <param name="diagnostics"></param>
public DiagnosticsException(IEnumerable<Diagnostic> diagnostics)
: base(string.Join("\n", diagnostics.Select(d => d.ToString())))
{
this.Diagnostics = diagnostics.ToArray();
}

public IEnumerable<Diagnostic> Diagnostics { get; }
/// <summary>
/// Diagnostics encountered during code generation.
/// </summary>
public ICollection<Diagnostic> Diagnostics { get; }
}
}
24 changes: 12 additions & 12 deletions src/Dapr.Actors.Generators/Helpers/SyntaxFactoryHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ namespace Dapr.Actors.Generators.Helpers
public static partial class SyntaxFactoryHelpers
{
/// <summary>
/// Generates a syntax for <see cref="ArgumentNullException"></see> syntax for the given argument name.
/// Generates a syntax for <see cref="ArgumentNullException"/> syntax for the given argument name.
/// </summary>
/// <param name="argumentName"></param>
/// <returns></returns>
/// <param name="argumentName">Name of the argument that generated the exception.</param>
/// <returns>Returns <see cref="ThrowExpressionSyntax"/> used to throw an <see cref="ArgumentNullException"/>.</returns>
public static ThrowExpressionSyntax ThrowArgumentNullException(string argumentName)
{
return SyntaxFactory.ThrowExpression(
Expand All @@ -33,8 +33,8 @@ public static ThrowExpressionSyntax ThrowArgumentNullException(string argumentNa
/// <summary>
/// Generates a syntax for null check for the given argument name.
/// </summary>
/// <param name="argumentName"></param>
/// <returns></returns>
/// <param name="argumentName">Name of the argument whose null check is to be generated.</param>
/// <returns>Returns <see cref="IfStatementSyntax"/> representing an argument null check.</returns>
public static IfStatementSyntax ThrowIfArgumentNull(string argumentName)
{
return SyntaxFactory.IfStatement(
Expand All @@ -53,8 +53,8 @@ public static IfStatementSyntax ThrowIfArgumentNull(string argumentName)
/// <summary>
/// Generates a syntax for nameof expression for the given argument name.
/// </summary>
/// <param name="argumentName"></param>
/// <returns></returns>
/// <param name="argumentName">Name of the argument from which the syntax is to be generated.</param>
/// <returns>Return a <see cref="ExpressionSyntax"/> representing a NameOf expression.</returns>
public static ExpressionSyntax NameOfExpression(string argumentName)
{
var nameofIdentifier = SyntaxFactory.Identifier(
Expand All @@ -76,11 +76,11 @@ public static ExpressionSyntax NameOfExpression(string argumentName)
/// <summary>
/// Generates the invocation syntax to call a remote method with the actor proxy.
/// </summary>
/// <param name="actorProxyMemberSyntax">Memeber syntax to access actorProxy member.</param>
/// <param name="actorProxyMemberSyntax">Member syntax to access actorProxy member.</param>
/// <param name="remoteMethodName">Name of remote method to invoke.</param>
/// <param name="remoteMethodParameters">Remote method parameters.</param>
/// <param name="remoteMethodReturnTypes">Return types of remote method invocation.</param>
/// <returns></returns>
/// <returns>The <see cref="InvocationExpressionSyntax"/> representing a call to the actor proxy.</returns>
public static InvocationExpressionSyntax ActorProxyInvokeMethodAsync(
MemberAccessExpressionSyntax actorProxyMemberSyntax,
string remoteMethodName,
Expand Down Expand Up @@ -124,9 +124,9 @@ public static InvocationExpressionSyntax ActorProxyInvokeMethodAsync(
/// <summary>
/// Returns the syntax kinds for the specified accessibility.
/// </summary>
/// <param name="accessibility"></param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
/// <param name="accessibility">Accessibility to convert into a SyntaxKind.</param>
/// <returns>Return the collection of <see cref="SyntaxKind"/> representing the given accessibility.</returns>
/// <exception cref="InvalidOperationException">Throws when un unexpected syntax is passed.</exception>
public static ICollection<SyntaxKind> GetSyntaxKinds(Accessibility accessibility)
{
var syntaxKinds = new List<SyntaxKind>();
Expand Down
16 changes: 8 additions & 8 deletions src/Dapr.Actors.Generators/Templates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ namespace Dapr.Actors.Generators
internal static partial class Templates
{
/// <summary>
/// Returns the source text for the ActorMethodAttribute.
/// Returns the <see cref="SourceText"/> for the ActorMethodAttribute.
/// </summary>
/// <param name="destinationNamespace"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
/// <param name="destinationNamespace">Namespace where to generate attribute.</param>
/// <returns>The <see cref="SourceText"/> representing the ActorMethodAttribute.</returns>
/// <exception cref="ArgumentNullException">Throws when destinationNamespace is null.</exception>
public static SourceText ActorMethodAttributeSourceText(string destinationNamespace)
{
if (destinationNamespace == null)
Expand Down Expand Up @@ -47,11 +47,11 @@ internal sealed class {Constants.ActorMethodAttributeTypeName} : Attribute
}

/// <summary>
/// Returns the source text for the GenerateActorClientAttribute.
/// Returns the <see cref="SourceText"/> for the GenerateActorClientAttribute.
/// </summary>
/// <param name="destinationNamespace"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
/// <param name="destinationNamespace">Namespace where to generate attribute.</param>
/// <returns>The <see cref="SourceText"/> representing the ActorMethodAttribute.</returns>
/// <exception cref="ArgumentNullException">Throws when destinationNamespace is null.</exception>
public static SourceText GenerateActorClientAttributeSourceText(string destinationNamespace)
{
if (destinationNamespace == null)
Expand Down

0 comments on commit 53964b4

Please sign in to comment.