Skip to content

Commit

Permalink
Add FromDocumentAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat committed Feb 11, 2022
1 parent 98aa5ea commit 1cba929
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.OrganizeImports;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.Formatting
{
Expand All @@ -24,5 +27,8 @@ public OmniSharpOrganizeImportsOptionsWrapper(
newLine))
{
}

public static async ValueTask<OmniSharpOrganizeImportsOptionsWrapper> FromDocumentAsync(Document document, CancellationToken cancellationToken)
=> new(await OrganizeImportsOptions.FromDocumentAsync(document, cancellationToken).ConfigureAwait(false));
}
}

0 comments on commit 1cba929

Please sign in to comment.