/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/BrokeredServices/ServiceBrokerShutdown.cs
35 строк
1 KB
David Barbet
Make C#DK service broker fully per server
06 май 2026, 04:01
06 май 2026, 04:01
6e5eadd
Код
Авторство
О чём код?
// 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.Composition; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.LanguageServer.Handler; using Microsoft.CommonLanguageServerProtocol.Framework; namespace Microsoft.CodeAnalysis.LanguageServer.BrokeredServices; internal class ServiceBrokerShutdown(ServiceBrokerFactory serviceBrokerFactory) : IOnServerShutdown, ILspService { [ExportCSharpVisualBasicLspServiceFactory(typeof(ServiceBrokerShutdown)), Shared] [method: ImportingConstructor] [method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] private class ServiceBrokerShutdownFactory() : ILspServiceFactory { public ILspService CreateILspService(LspServices lspServices, WellKnownLspServerKinds serverKind) { var serviceBrokerFactory = lspServices.GetRequiredService<ServiceBrokerFactory>(); return new ServiceBrokerShutdown(serviceBrokerFactory); } } public Task ExitAsync() { return Task.CompletedTask; } public async Task ShutdownAsync() { await serviceBrokerFactory.ShutdownAndWaitForCompletionAsync().ConfigureAwait(false); } }