Skip to content

Commit

Permalink
Use well-known method name
Browse files Browse the repository at this point in the history
  • Loading branch information
bash committed Oct 28, 2022
1 parent c89547c commit 010dc0c
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Microsoft.CodeAnalysis.Simplification;
using static Funcky.Analyzers.CodeFixResources;
using static Funcky.Analyzers.EnumerableRepeatOnceAnalyzer;
using static Funcky.Analyzers.FunckyWellKnownMemberNames;
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;

namespace Funcky.Analyzers;
Expand All @@ -17,8 +18,6 @@ namespace Funcky.Analyzers;
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(EnumerableRepeatOnceCodeFix))]
public sealed class EnumerableRepeatOnceCodeFix : CodeFixProvider
{
private const string Return = "Return";

public override ImmutableArray<string> FixableDiagnosticIds
=> ImmutableArray.Create(DiagnosticId);

Expand Down Expand Up @@ -78,7 +77,7 @@ private static InvocationExpressionSyntax SyntaxSequenceReturn(SemanticModel mod
MemberAccessExpression(
SyntaxKind.SimpleMemberAccessExpression,
(ExpressionSyntax)generator.TypeExpressionForStaticMemberAccess(model.Compilation.GetSequenceType()!),
IdentifierName(Return))
IdentifierName(MonadReturnMethodName))
.WithAdditionalAnnotations(Simplifier.Annotation));
}
}

0 comments on commit 010dc0c

Please sign in to comment.