/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Workspaces/Remote/ServiceHub/Services/FullyQualify/RemoteFullyQualifyService.cs
38 строк
2 KB
David Wengier
PR feedback
24 мар 2025, 01:16
24 мар 2025, 01:16
07df90a
Код
Авторство
О чём код?
// 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.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.CodeFixes.FullyQualify; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis.Remote; internal sealed class RemoteFullyQualifyService : BrokeredServiceBase, IRemoteFullyQualifyService { internal sealed class Factory : FactoryBase<IRemoteFullyQualifyService> { protected override IRemoteFullyQualifyService CreateService(in ServiceConstructionArguments arguments) => new RemoteFullyQualifyService(arguments); } public RemoteFullyQualifyService(in ServiceConstructionArguments arguments) : base(arguments) { } public ValueTask<FullyQualifyFixData?> GetFixDataAsync(Checksum solutionChecksum, DocumentId documentId, TextSpan span, CancellationToken cancellationToken) { return RunServiceAsync(solutionChecksum, async solution => { // Including source generated documents as this service is used in Razor scenarios. var document = await solution.GetRequiredDocumentAsync(documentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); var service = document.GetRequiredLanguageService<IFullyQualifyService>(); return await service.GetFixDataAsync(document, span, cancellationToken).ConfigureAwait(false); }, cancellationToken); } }