Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
nenoNaninu committed Mar 31, 2024
1 parent 8340bb7 commit 045ee20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/TypedSignalR.Client/CodeAnalysis/MethodMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public MethodMetadata(IMethodSymbol methodSymbol)
.Select(x => new ParameterMetadata(x))
.ToArray();

ReturnType = methodSymbol.ReturnType.ToDisplayString(SymbolDisplayFormatRule.FullyQualifiedNullableFormat);
ReturnType = methodSymbol.ReturnType.ToDisplayString(SymbolDisplayFormatRule.FullyQualifiedNullableReferenceTypeFormat);

INamedTypeSymbol? returnTypeSymbol = methodSymbol.ReturnType as INamedTypeSymbol;

Expand All @@ -36,8 +36,8 @@ public MethodMetadata(IMethodSymbol methodSymbol)
if (returnTypeSymbol.IsGenericType)
{
GenericReturnTypeArgument = returnTypeSymbol.TypeArguments.Length == 1
? returnTypeSymbol.TypeArguments[0].ToDisplayString(SymbolDisplayFormatRule.FullyQualifiedNullableFormat)
: string.Join(", ", returnTypeSymbol.TypeArguments.Select(x => x.ToDisplayString(SymbolDisplayFormatRule.FullyQualifiedNullableFormat)));
? returnTypeSymbol.TypeArguments[0].ToDisplayString(SymbolDisplayFormatRule.FullyQualifiedNullableReferenceTypeFormat)
: string.Join(", ", returnTypeSymbol.TypeArguments.Select(x => x.ToDisplayString(SymbolDisplayFormatRule.FullyQualifiedNullableReferenceTypeFormat)));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/TypedSignalR.Client/CodeAnalysis/ParameterMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public ParameterMetadata(IParameterSymbol parameterSymbol)
? $"@{parameterSymbol.Name}"
: parameterSymbol.Name;

TypeName = parameterSymbol.Type.ToDisplayString(SymbolDisplayFormatRule.FullyQualifiedNullableFormat);
TypeName = parameterSymbol.Type.ToDisplayString(SymbolDisplayFormatRule.FullyQualifiedNullableReferenceTypeFormat);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ internal static class SymbolDisplayFormatRule
{
public static SymbolDisplayFormat FullyQualifiedFormat { get; } = SymbolDisplayFormat.FullyQualifiedFormat;

public static SymbolDisplayFormat FullyQualifiedNullableFormat { get; } = SymbolDisplayFormat.FullyQualifiedFormat
public static SymbolDisplayFormat FullyQualifiedNullableReferenceTypeFormat { get; } = SymbolDisplayFormat.FullyQualifiedFormat
.AddMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.IncludeNullableReferenceTypeModifier);
}

0 comments on commit 045ee20

Please sign in to comment.