зеркало из https://github.com/dotnet/razor.git
Ensure that the `RazorLanguageServerHost` is disposed
This commit is contained in:
Родитель
29a48005ce
Коммит
b5158d7b7b
|
@ -128,6 +128,24 @@ internal class RazorLanguageServerClient(
|
|||
}
|
||||
}
|
||||
|
||||
private async Task EnsureCleanedUpServerAsync()
|
||||
{
|
||||
if (_host is null)
|
||||
{
|
||||
// Server was already cleaned up
|
||||
return;
|
||||
}
|
||||
|
||||
if (_host is not null)
|
||||
{
|
||||
// Server still hasn't shutdown, wait for it to shutdown
|
||||
await _host.WaitForExitAsync().ConfigureAwait(false);
|
||||
|
||||
_host.Dispose();
|
||||
_host = null;
|
||||
}
|
||||
}
|
||||
|
||||
internal static IEnumerable<Lazy<ILanguageClient, LanguageServer.Client.IContentTypeMetadata>> GetRelevantContainedLanguageClientsAndMetadata(ILanguageServiceBroker2 languageServiceBroker)
|
||||
{
|
||||
var relevantClientAndMetadata = new List<Lazy<ILanguageClient, LanguageServer.Client.IContentTypeMetadata>>();
|
||||
|
@ -186,21 +204,6 @@ internal class RazorLanguageServerClient(
|
|||
_lspServerActivationTracker.Activated();
|
||||
}
|
||||
|
||||
private async Task EnsureCleanedUpServerAsync()
|
||||
{
|
||||
if (_host is null)
|
||||
{
|
||||
// Server was already cleaned up
|
||||
return;
|
||||
}
|
||||
|
||||
if (_host is not null)
|
||||
{
|
||||
// Server still hasn't shutdown, wait for it to shutdown
|
||||
await _host.WaitForExitAsync().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
public Task AttachForCustomMessageAsync(JsonRpc rpc) => Task.CompletedTask;
|
||||
|
||||
public Task<InitializationFailureContext?> OnServerInitializeFailedAsync(ILanguageClientInitializationInfo initializationState)
|
||||
|
|
Загрузка…
Ссылка в новой задаче