Skip to content

Commit

Permalink
Merge pull request #156 from nenoNaninu/improve_diagnostic
Browse files Browse the repository at this point in the history
Improve diagnostic
  • Loading branch information
nenoNaninu authored Nov 23, 2023
2 parents 2e41786 + 43d82dc commit d4a00ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/TypedSignalR.Client/AnalyzerReleases.Shipped.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ Rule ID | Category | Severity | Notes
TSRC000 | Usage | Error | Unexpected exception.
TSRC001 | Usage | Error | The type argument must be an interface.
TSRC002 | Usage | Error | Only method definitions are allowed in the interface.
TSRC003 | Usage | Error | The return type of methods in the interface must be Task, Task<T>, IAsyncEnumerable<T>, Task<IAsyncEnumerable<T> or Task<ChannelReader<T>>.
TSRC004 | Usage | Error | The return type of methods in the interface must be Task or Task<T>.
TSRC003 | Usage | Error | The return type of methods in the interface used for hub proxy must be Task, Task<T>, IAsyncEnumerable<T>, Task<IAsyncEnumerable<T>> or Task<ChannelReader<T>>.
TSRC004 | Usage | Error | The return type of methods in the interface used for receiver must be Task or Task<T>.
TSRC005 | Usage | Error | CancellationToken can be used as a parameter only in the server-to-client streaming method.
TSRC006 | Usage | Error | Using IAsyncEnumerable<T> or ChannelReader<T> as a parameter in a server-to-client streaming method is prohibited.
TSRC007 | Usage | Error | The return type of client-to-server streaming method must be Task.
TSRC006 | Usage | Error | Using multiple CancellationToken in method parameters is prohibited.
TSRC007 | Usage | Error | Using IAsyncEnumerable<T> or ChannelReader<T> as a parameter in a server-to-client streaming method is prohibited.
TSRC008 | Usage | Error | The return type of client-to-server streaming method must be Task.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public static class DiagnosticDescriptorItems
category: "Usage",
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
description: "The return type of methods in the interface must be Task or Task<T>.");
description: "The return type of methods in the interface used for receiver must be Task or Task<T>.");

public static readonly DiagnosticDescriptor HubMethodCancellationTokenParameterRule = new(
id: "TSRC005",
title: "CancellationToken can be used as a parameter only in the server-to-client streaming method",
messageFormat: "CancellationToken cannot be used as a parameter in the {0}.",
messageFormat: "CancellationToken cannot be used as a parameter in the {0}",
category: "Usage",
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
Expand All @@ -61,7 +61,7 @@ public static class DiagnosticDescriptorItems
public static readonly DiagnosticDescriptor HubMethodMultipleCancellationTokenParameterRule = new(
id: "TSRC006",
title: "Using multiple CancellationToken in method parameters is prohibited",
messageFormat: "Multiple CancellationToken cannot be used as a parameter in the {0}.",
messageFormat: "Multiple CancellationToken cannot be used as a parameter in the {0}",
category: "Usage",
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
Expand All @@ -70,7 +70,7 @@ public static class DiagnosticDescriptorItems
public static readonly DiagnosticDescriptor ServerStreamingMethodParameterRule = new(
id: "TSRC007",
title: "Using IAsyncEnumerable<T> or ChannelReader<T> as a parameter in a server-to-client streaming method is prohibited",
messageFormat: "Do not use IAsyncEnumerable<T> or ChannelReader<T> as a parameter because the {0} was analyzed as a server-to-client streaming method.",
messageFormat: "Do not use IAsyncEnumerable<T> or ChannelReader<T> as a parameter because the {0} was analyzed as a server-to-client streaming method",
category: "Usage",
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
Expand Down

0 comments on commit d4a00ca

Please sign in to comment.