/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Workspaces/Remote/ServiceHub/Services/Copilot/RemoteCopilotChangeAnalysisService.cs
39 строк
2 KB
Cyrus Najmabadi
Report telemetry
29 апр 2025, 23:49
29 апр 2025, 23:49
68c533b
Код
Авторство
О чём код?
// 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.Collections.Immutable; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Copilot; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis.Remote; internal sealed partial class RemoteCopilotChangeAnalysisService( in BrokeredServiceBase.ServiceConstructionArguments arguments) : BrokeredServiceBase(arguments), IRemoteCopilotChangeAnalysisService { internal sealed class Factory : FactoryBase<IRemoteCopilotChangeAnalysisService> { protected override IRemoteCopilotChangeAnalysisService CreateService(in ServiceConstructionArguments arguments) => new RemoteCopilotChangeAnalysisService(arguments); } public ValueTask<CopilotChangeAnalysis> AnalyzeChangeAsync( Checksum solutionChecksum, DocumentId documentId, ImmutableArray<TextChange> edits, CancellationToken cancellationToken) { return RunServiceAsync(solutionChecksum, async solution => { var document = await solution.GetRequiredDocumentAsync( documentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); var service = solution.Services.GetRequiredService<ICopilotChangeAnalysisService>(); return await service.AnalyzeChangeAsync(document, edits, cancellationToken).ConfigureAwait(false); }, cancellationToken); } }