Skip to content

Commit

Permalink
Add VSTypeScriptAsynchronousTaggerProvider (dotnet#57310)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat authored Oct 23, 2021
1 parent 145752d commit 1667bc6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Editor.Tagging;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Microsoft.VisualStudio.Text.Tagging;

namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api
{
internal abstract class VSTypeScriptAsynchronousTaggerProvider<TTag> : AsynchronousViewTaggerProvider<TTag>
where TTag : ITag
{
protected VSTypeScriptAsynchronousTaggerProvider(
IThreadingContext threadingContext,
IAsynchronousOperationListenerProvider asyncListenerProvider,
#pragma warning disable IDE0060 // TODO: use global options
VSTypeScriptGlobalOptions globalOptions)
#pragma warning restore IDE0060
: base(threadingContext, asyncListenerProvider.GetListener(FeatureAttribute.Classification))
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Licensed to the .NET Foundation under one or more agreements.
// 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.Editor;

namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api
{
internal abstract class VSTypeScriptBraceMatcher : IBraceMatcher
{
Task<BraceMatchingResult?> IBraceMatcher.FindBracesAsync(Document document, int position, CancellationToken cancellationToken)
=> FindBracesAsync(document, position, cancellationToken);

protected abstract Task<BraceMatchingResult?> FindBracesAsync(Document document, int position, CancellationToken cancellationToken);
}
}

0 comments on commit 1667bc6

Please sign in to comment.