public static async Task <IEnumerable <SuggestedActionSet> > WaitForItemsAsync(ILightBulbBroker broker, IWpfTextView view) { using var cancellationTokenSource = new CancellationTokenSource(Helper.HangMitigatingTimeout); var editor = Editor_InProc.Create(); while (true) { var items = await TryWaitForItemsAsync(broker, view, cancellationTokenSource.Token); if (items is not null) { return(items); } // The session was dismissed unexpectedly. The editor might show it again. editor.WaitForEditorOperations(Helper.HangMitigatingTimeout); } }