From 37616309333c27d2da98b35935c600bfe1f80037 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Fri, 20 Oct 2023 14:50:52 -0500 Subject: [PATCH] Revert "Merge pull request #1920 from dotnet/darc-main-c4635c16-72c5-47ff-a963-b5c7e29bd9cb" This reverts commit e2182d1349594e2efd593bd0616df22d7e809413, reversing changes made to f1776de9f545a1b67ddf3fffc7def95024a6bdb3. --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 4 ++-- src/Commands/FormatAnalyzersCommand.cs | 5 +++-- src/Commands/FormatStyleCommand.cs | 5 +++-- src/Commands/FormatWhitespaceCommand.cs | 5 +++-- src/Commands/RootFormatCommand.cs | 5 +++-- 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c6e847b3c1..e9cf2fb358 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -34,18 +34,18 @@ https://github.com/dotnet/runtime 60b77a63df30362ed1c66a834fcb8f8956ea113b - + https://github.com/dotnet/command-line-api - a045dd54a4c44723c215d992288160eb1401bb7f + 02fe27cd6a9b001c8feb7938e6ef4b3799745759 - + https://github.com/dotnet/command-line-api - a045dd54a4c44723c215d992288160eb1401bb7f + 02fe27cd6a9b001c8feb7938e6ef4b3799745759 - + https://github.com/dotnet/command-line-api - a045dd54a4c44723c215d992288160eb1401bb7f + 02fe27cd6a9b001c8feb7938e6ef4b3799745759 diff --git a/eng/Versions.props b/eng/Versions.props index 598b9b04ab..599f86bba7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -17,8 +17,8 @@ - 2.0.0-beta4.23407.1 - 0.4.0-alpha.23407.1 + 2.0.0-beta4.23307.1 + 0.4.0-alpha.23307.1 10.3.0 diff --git a/src/Commands/FormatAnalyzersCommand.cs b/src/Commands/FormatAnalyzersCommand.cs index 6ee5c51a0c..4ecbb180c3 100644 --- a/src/Commands/FormatAnalyzersCommand.cs +++ b/src/Commands/FormatAnalyzersCommand.cs @@ -2,7 +2,6 @@ using System.Collections.Immutable; using System.CommandLine; -using System.CommandLine.Invocation; using System.CommandLine.IO; using System.Threading; using System.Threading.Tasks; @@ -28,8 +27,10 @@ internal static CliCommand GetCommand() return command; } - private class FormatAnalyzersHandler : AsynchronousCliAction + private class FormatAnalyzersHandler : CliAction { + public override int Invoke(ParseResult parseResult) => InvokeAsync(parseResult, CancellationToken.None).GetAwaiter().GetResult(); + public override async Task InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken) { var formatOptions = parseResult.ParseVerbosityOption(FormatOptions.Instance); diff --git a/src/Commands/FormatStyleCommand.cs b/src/Commands/FormatStyleCommand.cs index f089198a86..cddf23cad7 100644 --- a/src/Commands/FormatStyleCommand.cs +++ b/src/Commands/FormatStyleCommand.cs @@ -2,7 +2,6 @@ using System.Collections.Immutable; using System.CommandLine; -using System.CommandLine.Invocation; using System.CommandLine.IO; using System.Threading; using System.Threading.Tasks; @@ -28,8 +27,10 @@ internal static CliCommand GetCommand() return command; } - private class FormatStyleHandler : AsynchronousCliAction + private class FormatStyleHandler : CliAction { + public override int Invoke(ParseResult parseResult) => InvokeAsync(parseResult, CancellationToken.None).GetAwaiter().GetResult(); + public override async Task InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken) { var formatOptions = parseResult.ParseVerbosityOption(FormatOptions.Instance); diff --git a/src/Commands/FormatWhitespaceCommand.cs b/src/Commands/FormatWhitespaceCommand.cs index 382b601dbb..de62c51cd3 100644 --- a/src/Commands/FormatWhitespaceCommand.cs +++ b/src/Commands/FormatWhitespaceCommand.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. using System.CommandLine; -using System.CommandLine.Invocation; using System.CommandLine.IO; using System.CommandLine.Parsing; using System.Threading; @@ -63,8 +62,10 @@ internal static void EnsureFolderNotSpecifiedWhenLoggingBinlog(CommandResult sym } } - private class FormatWhitespaceHandler : AsynchronousCliAction + private class FormatWhitespaceHandler : CliAction { + public override int Invoke(ParseResult parseResult) => InvokeAsync(parseResult, CancellationToken.None).GetAwaiter().GetResult(); + public override async Task InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken) { var formatOptions = parseResult.ParseVerbosityOption(FormatOptions.Instance); diff --git a/src/Commands/RootFormatCommand.cs b/src/Commands/RootFormatCommand.cs index 07049a4842..79faa8edb1 100644 --- a/src/Commands/RootFormatCommand.cs +++ b/src/Commands/RootFormatCommand.cs @@ -2,7 +2,6 @@ using System.Collections.Immutable; using System.CommandLine; -using System.CommandLine.Invocation; using System.CommandLine.IO; using System.Threading; using System.Threading.Tasks; @@ -31,8 +30,10 @@ public static CliRootCommand GetCommand() return formatCommand; } - private class FormatCommandDefaultHandler : AsynchronousCliAction + private class FormatCommandDefaultHandler : CliAction { + public override int Invoke(ParseResult parseResult) => InvokeAsync(parseResult, CancellationToken.None).GetAwaiter().GetResult(); + public override async Task InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken) { var formatOptions = parseResult.ParseVerbosityOption(FormatOptions.Instance);