File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
EditorFeatures/Core.Wpf/Copilot
Workspaces/Core/Portable/CodeActions Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ internal sealed class CopilotWpfTextViewCreationListener : IWpfTextViewCreationL
3131{
3232 private readonly IThreadingContext _threadingContext ;
3333 private readonly Lazy < SuggestionServiceBase > _suggestionServiceBase ;
34+ private readonly IAsynchronousOperationListener _listener ;
3435
3536 private readonly AsyncBatchingWorkQueue < SuggestionAcceptedEventArgs > _workQueue ;
3637
@@ -45,10 +46,11 @@ public CopilotWpfTextViewCreationListener(
4546 {
4647 _threadingContext = threadingContext ;
4748 _suggestionServiceBase = suggestionServiceBase ;
49+ _listener = listenerProvider . GetListener ( FeatureAttribute . CopilotChangeAnalysis ) ;
4850 _workQueue = new AsyncBatchingWorkQueue < SuggestionAcceptedEventArgs > (
4951 DelayTimeSpan . Idle ,
5052 ProcessEventsAsync ,
51- listenerProvider . GetListener ( FeatureAttribute . CopilotChangeAnalysis ) ,
53+ _listener ,
5254 _threadingContext . DisposalToken ) ;
5355 }
5456
@@ -58,11 +60,12 @@ public void TextViewCreated(IWpfTextView textView)
5860 // from it.
5961 if ( Interlocked . CompareExchange ( ref _started , 1 , 0 ) == 0 )
6062 {
61- _ = Task . Run ( ( ) =>
63+ var token = _listener . BeginAsyncOperation ( nameof ( TextViewCreated ) ) ;
64+ Task . Run ( ( ) =>
6265 {
6366 var suggestionService = _suggestionServiceBase . Value ;
6467 suggestionService . SuggestionAccepted += OnSuggestionAccepted ;
65- } ) ;
68+ } ) . CompletesAsyncOperation ( token ) ;
6669 }
6770 }
6871
Original file line number Diff line number Diff line change 88using System . ComponentModel ;
99using System . Diagnostics ;
1010using System . Diagnostics . CodeAnalysis ;
11- using System . Linq ;
1211using System . Threading ;
1312using System . Threading . Tasks ;
1413using Microsoft . CodeAnalysis . CodeCleanup ;
You can’t perform that action at this time.
0 commit comments