diff --git a/src/Dapr.Actors.Generators/ActorClientGenerator.cs b/src/Dapr.Actors.Generators/ActorClientGenerator.cs index bec1d970..451bba2a 100644 --- a/src/Dapr.Actors.Generators/ActorClientGenerator.cs +++ b/src/Dapr.Actors.Generators/ActorClientGenerator.cs @@ -57,10 +57,9 @@ public void Initialize(IncrementalGeneratorInitializationContext context) /// /// Returns the descriptor for the actor client to generate. /// - /// - /// - /// - /// + /// Current generator syntax context passed from generator pipeline. + /// Cancellation token used to interrupt the generation. + /// Returns the descriptor of actor client to generate. static ActorClientDescriptor CreateActorClientDescriptor( GeneratorAttributeSyntaxContext context, CancellationToken cancellationToken) @@ -100,9 +99,9 @@ static ActorClientDescriptor CreateActorClientDescriptor( /// /// Generates the actor client code based on the specified descriptor. /// - /// - /// - /// + /// Context passed from the source generator when it has registered an output. + /// Descriptor of actor client to generate. + /// Throws when assembly doesn't one or more required symbols. static void GenerateActorClientCode(SourceProductionContext context, ActorClientDescriptor descriptor) { try diff --git a/src/Dapr.Actors.Generators/DiagnosticsException.cs b/src/Dapr.Actors.Generators/DiagnosticsException.cs index 35d5b9c6..19d4f075 100644 --- a/src/Dapr.Actors.Generators/DiagnosticsException.cs +++ b/src/Dapr.Actors.Generators/DiagnosticsException.cs @@ -2,14 +2,24 @@ namespace Dapr.Actors.Generators { + /// + /// Exception thrown when diagnostics are encountered during code generation. + /// internal sealed class DiagnosticsException : Exception { + /// + /// Initializes a new instance of the class. + /// + /// public DiagnosticsException(IEnumerable diagnostics) : base(string.Join("\n", diagnostics.Select(d => d.ToString()))) { this.Diagnostics = diagnostics.ToArray(); } - public IEnumerable Diagnostics { get; } + /// + /// Diagnostics encountered during code generation. + /// + public ICollection Diagnostics { get; } } } diff --git a/src/Dapr.Actors.Generators/Helpers/SyntaxFactoryHelpers.cs b/src/Dapr.Actors.Generators/Helpers/SyntaxFactoryHelpers.cs index 34f0604f..4996223b 100644 --- a/src/Dapr.Actors.Generators/Helpers/SyntaxFactoryHelpers.cs +++ b/src/Dapr.Actors.Generators/Helpers/SyntaxFactoryHelpers.cs @@ -10,10 +10,10 @@ namespace Dapr.Actors.Generators.Helpers public static partial class SyntaxFactoryHelpers { /// - /// Generates a syntax for syntax for the given argument name. + /// Generates a syntax for syntax for the given argument name. /// - /// - /// + /// Name of the argument that generated the exception. + /// Returns used to throw an . public static ThrowExpressionSyntax ThrowArgumentNullException(string argumentName) { return SyntaxFactory.ThrowExpression( @@ -33,8 +33,8 @@ public static ThrowExpressionSyntax ThrowArgumentNullException(string argumentNa /// /// Generates a syntax for null check for the given argument name. /// - /// - /// + /// Name of the argument whose null check is to be generated. + /// Returns representing an argument null check. public static IfStatementSyntax ThrowIfArgumentNull(string argumentName) { return SyntaxFactory.IfStatement( @@ -53,8 +53,8 @@ public static IfStatementSyntax ThrowIfArgumentNull(string argumentName) /// /// Generates a syntax for nameof expression for the given argument name. /// - /// - /// + /// Name of the argument from which the syntax is to be generated. + /// Return a representing a NameOf expression. public static ExpressionSyntax NameOfExpression(string argumentName) { var nameofIdentifier = SyntaxFactory.Identifier( @@ -76,11 +76,11 @@ public static ExpressionSyntax NameOfExpression(string argumentName) /// /// Generates the invocation syntax to call a remote method with the actor proxy. /// - /// Memeber syntax to access actorProxy member. + /// Member syntax to access actorProxy member. /// Name of remote method to invoke. /// Remote method parameters. /// Return types of remote method invocation. - /// + /// The representing a call to the actor proxy. public static InvocationExpressionSyntax ActorProxyInvokeMethodAsync( MemberAccessExpressionSyntax actorProxyMemberSyntax, string remoteMethodName, @@ -124,9 +124,9 @@ public static InvocationExpressionSyntax ActorProxyInvokeMethodAsync( /// /// Returns the syntax kinds for the specified accessibility. /// - /// - /// - /// + /// Accessibility to convert into a SyntaxKind. + /// Return the collection of representing the given accessibility. + /// Throws when un unexpected syntax is passed. public static ICollection GetSyntaxKinds(Accessibility accessibility) { var syntaxKinds = new List(); diff --git a/src/Dapr.Actors.Generators/Templates.cs b/src/Dapr.Actors.Generators/Templates.cs index fe393ddb..a9482a98 100644 --- a/src/Dapr.Actors.Generators/Templates.cs +++ b/src/Dapr.Actors.Generators/Templates.cs @@ -11,11 +11,11 @@ namespace Dapr.Actors.Generators internal static partial class Templates { /// - /// Returns the source text for the ActorMethodAttribute. + /// Returns the for the ActorMethodAttribute. /// - /// - /// - /// + /// Namespace where to generate attribute. + /// The representing the ActorMethodAttribute. + /// Throws when destinationNamespace is null. public static SourceText ActorMethodAttributeSourceText(string destinationNamespace) { if (destinationNamespace == null) @@ -47,11 +47,11 @@ internal sealed class {Constants.ActorMethodAttributeTypeName} : Attribute } /// - /// Returns the source text for the GenerateActorClientAttribute. + /// Returns the for the GenerateActorClientAttribute. /// - /// - /// - /// + /// Namespace where to generate attribute. + /// The representing the ActorMethodAttribute. + /// Throws when destinationNamespace is null. public static SourceText GenerateActorClientAttributeSourceText(string destinationNamespace) { if (destinationNamespace == null)