From 010dc0c8444246b1b13138487eafb90fe3c2b332 Mon Sep 17 00:00:00 2001 From: Ruben Schmidmeister <4602612+bash@users.noreply.github.com> Date: Fri, 28 Oct 2022 10:57:04 +0200 Subject: [PATCH] Use well-known method name --- .../EnumerableRepeatOnceCodeFix.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Funcky.Analyzers/Funcky.Analyzers.CodeFixes/EnumerableRepeatOnceCodeFix.cs b/Funcky.Analyzers/Funcky.Analyzers.CodeFixes/EnumerableRepeatOnceCodeFix.cs index 6b7aec3b..00669f51 100644 --- a/Funcky.Analyzers/Funcky.Analyzers.CodeFixes/EnumerableRepeatOnceCodeFix.cs +++ b/Funcky.Analyzers/Funcky.Analyzers.CodeFixes/EnumerableRepeatOnceCodeFix.cs @@ -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; @@ -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 FixableDiagnosticIds => ImmutableArray.Create(DiagnosticId); @@ -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)); } }