Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,21 @@ internal sealed class AlwaysActiveLanguageClientEventListener(
public void StartListening(Workspace workspace)
{
// Trigger a fire and forget request to the VS LSP client to load our ILanguageClient.
_ = LoadAsync();
Load();
}

public void StopListening(Workspace workspace)
{
// Nothing to do here. There's no concept of unloading an ILanguageClient.
}

private async Task LoadAsync()
private void Load()
{
try
using var token = _asynchronousOperationListener.BeginAsyncOperation(nameof(Load));
LoadAsync().ReportNonFatalErrorAsync().CompletesAsyncOperation(token);

async Task LoadAsync()
{
using var token = _asynchronousOperationListener.BeginAsyncOperation(nameof(LoadAsync));

// Explicitly switch to the bg so that if this causes any expensive work (like mef loads) it
// doesn't block the UI thread. Note, we always yield because sometimes our caller starts
Expand All @@ -67,9 +69,6 @@ await _languageClientBroker.Value.LoadAsync(new LanguageClientMetadata(
ContentTypeNames.FSharpContentType
]), _languageClient).ConfigureAwait(false);
}
catch (Exception e) when (FatalError.ReportAndCatch(e))
{
}
}

/// <summary>
Expand Down
Loading