Skip to content

Commit

Permalink
Post merge problems fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
TKharaishvili committed Apr 12, 2022
1 parent 62f138e commit c230316
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.

using System;
using System.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;
using Analyzer.Utilities;
using Analyzer.Utilities.Extensions;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Editing;

Expand All @@ -26,13 +26,13 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
var generator = SyntaxGenerator.GetGenerator(context.Document);

var title = MicrosoftNetCoreAnalyzersResources.SpecifyCurrentCulture;
context.RegisterCodeFix(new MyCodeAction(title,
context.RegisterCodeFix(CodeAction.Create(title,
async ct => await SpecifyCurrentCultureAsync(context.Document, generator, root, node, ct).ConfigureAwait(false),
equivalenceKey: nameof(MicrosoftNetCoreAnalyzersResources.SpecifyCurrentCulture)),
context.Diagnostics);

title = MicrosoftNetCoreAnalyzersResources.UseInvariantVersion;
context.RegisterCodeFix(new MyCodeAction(title,
context.RegisterCodeFix(CodeAction.Create(title,
async ct => await UseInvariantVersionAsync(context.Document, generator, root, node).ConfigureAwait(false),
equivalenceKey: nameof(MicrosoftNetCoreAnalyzersResources.UseInvariantVersion)),
context.Diagnostics);
Expand Down Expand Up @@ -60,15 +60,6 @@ protected static SyntaxNode CreateCurrentCultureMemberAccess(SyntaxGenerator gen
_ => currentMethodName,
};

// Needed for Telemetry (https://github.com/dotnet/roslyn-analyzers/issues/192)
private class MyCodeAction : DocumentChangeAction
{
public MyCodeAction(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string equivalenceKey)
: base(title, createChangedDocument, equivalenceKey)
{
}
}

public sealed override FixAllProvider GetFixAllProvider()
{
return WellKnownFixAllProviders.BatchFixer;
Expand Down

0 comments on commit c230316

Please sign in to comment.