/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/LanguageServer/ExternalAccess/CompilerDeveloperSDK/Handler/AbstractCompilerDeveloperSdkLspServiceDocumentRequestHandler.cs
28 строк
2 KB
David Barbet
Make TextDocumentIdentifier changes backwards compatible
15 апр 2025, 02:13
15 апр 2025, 02:13
bb63a79
Код
Авторство
О чём код?
// 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; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.LanguageServer.Handler; using Microsoft.CommonLanguageServerProtocol.Framework; using Roslyn.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.ExternalAccess.CompilerDeveloperSdk; internal abstract class AbstractCompilerDeveloperSdkLspServiceDocumentRequestHandler<TRequest, TResponse> : ILspServiceDocumentRequestHandler<TRequest, TResponse> { public abstract bool RequiresLSPSolution { get; } public abstract Task<TResponse> HandleRequestAsync(TRequest request, RequestContext context, CancellationToken cancellationToken); public abstract Uri GetTextDocumentIdentifier(TRequest request); public abstract bool MutatesSolutionState { get; } bool IMethodHandler.MutatesSolutionState => MutatesSolutionState; bool ISolutionRequiredHandler.RequiresLSPSolution => RequiresLSPSolution; TextDocumentIdentifier ITextDocumentIdentifierHandler<TRequest, TextDocumentIdentifier>.GetTextDocumentIdentifier(TRequest request) => new() { DocumentUri = new(GetTextDocumentIdentifier(request)) }; Task<TResponse> IRequestHandler<TRequest, TResponse, LspRequestContext>.HandleRequestAsync(TRequest request, LspRequestContext context, CancellationToken cancellationToken) => HandleRequestAsync(request, new RequestContext(context), cancellationToken); }