4 interfaces inheriting from IMethodHandler
Microsoft.CommonLanguageServerProtocol.Framework.Package (4)
INotificationHandler.cs (2)
17
internal interface INotificationHandler<TRequestContext> :
IMethodHandler
27
internal interface INotificationHandler<TRequest, TRequestContext> :
IMethodHandler
IRequestHandler.cs (2)
12
internal interface IRequestHandler<TRequest, TResponse, TRequestContext> :
IMethodHandler
24
internal interface IRequestHandler<TResponse, TRequestContext> :
IMethodHandler
44 references to IMethodHandler
Microsoft.CommonLanguageServerProtocol.Framework.Package (44)
AbstractHandlerProvider.cs (2)
24
/// Gets the <see cref="
IMethodHandler
"/>s for a particular request.
35
public abstract
IMethodHandler
GetMethodHandler(string method, TypeRef? requestTypeRef, TypeRef? responseTypeRef, string language);
AbstractRequestContextFactory.cs (3)
18
/// RequestContext's are useful for passing document context, since by default <see cref="CreateRequestContextAsync{TRequestParam}(IQueueItem{TRequestContext},
IMethodHandler
, TRequestParam, CancellationToken)"/>
31
/// <param name="methodHandler">The <see cref="
IMethodHandler
"/> for which to create the request context</param>
36
public abstract Task<TRequestContext> CreateRequestContextAsync<TRequestParam>(IQueueItem<TRequestContext> queueItem,
IMethodHandler
methodHandler, TRequestParam requestParam, CancellationToken cancellationToken);
HandlerProvider.cs (12)
21
private FrozenDictionary<RequestHandlerMetadata, Lazy<
IMethodHandler
>>? _requestHandlers;
23
public
IMethodHandler
GetMethodHandler(string method, TypeRef? requestTypeRef, TypeRef? responseTypeRef)
26
public override
IMethodHandler
GetMethodHandler(string method, TypeRef? requestTypeRef, TypeRef? responseTypeRef, string language)
45
private FrozenDictionary<RequestHandlerMetadata, Lazy<
IMethodHandler
>> GetRequestHandlers()
48
private static FrozenDictionary<RequestHandlerMetadata, Lazy<
IMethodHandler
>> CreateMethodToHandlerMap(ILspServices lspServices, AbstractTypeRefResolver typeRefResolver)
50
var builder = new Dictionary<RequestHandlerMetadata, Lazy<
IMethodHandler
>>();
76
var handlers = lspServices.GetRequiredServices<
IMethodHandler
>();
78
foreach (
var
handler in handlers)
98
static Lazy<
IMethodHandler
> GetLazyHandlerFromInstance(
IMethodHandler
instance)
103
static Lazy<
IMethodHandler
> GetLazyHandlerFromTypeRef(ILspServices lspServices, AbstractTypeRefResolver typeRefResolver, TypeRef handlerTypeRef)
115
return (
IMethodHandler
)lspService;
IMethodHandlerProvider.cs (2)
14
/// to provide faster access to <see cref="
IMethodHandler
"/>s.
18
ImmutableArray<(
IMethodHandler
? Instance, TypeRef HandlerTypeRef, ImmutableArray<MethodHandlerDetails> HandlerDetails)> GetMethodHandlers();
IQueueItem.cs (4)
24
/// <param name="context">The context created by <see cref="CreateRequestContextAsync{TRequest}(
IMethodHandler
, RequestHandlerMetadata, AbstractLanguageServer{TRequestContext}, CancellationToken)"/>.</param>
29
Task StartRequestAsync<TRequest, TResponse>(TRequest request, TRequestContext? context,
IMethodHandler
handler, string language, CancellationToken cancellationToken);
34
/// running the actual request in <see cref="StartRequestAsync{TRequest, TResponse}(TRequest, TRequestContext?,
IMethodHandler
, string, CancellationToken)"/>
39
Task<(TRequestContext, TRequest)?> CreateRequestContextAsync<TRequest>(
IMethodHandler
handler, RequestHandlerMetadata requestHandlerMetadata, AbstractLanguageServer<TRequestContext> languageServer, CancellationToken cancellationToken);
LanguageServerEndpointAttribute.cs (6)
13
/// An attribute which identifies the method which an <see cref="
IMethodHandler
"/> implements.
19
/// Contains the method that this <see cref="
IMethodHandler
"/> implements.
24
/// Contains the language name(s) supported by this <see cref="
IMethodHandler
"/>.
35
/// Specifies the method that this <see cref="
IMethodHandler
"/> implements and the language(s) supported by it.
38
/// <param name="language">The language name supported by this <see cref="
IMethodHandler
"/>. For example, <see cref="LanguageServerConstants.DefaultLanguageName"/>, 'C#', etc.</param>
39
/// <param name="additionalLanguages">Additional language names supported by this <see cref="
IMethodHandler
"/>.</param>
MethodHandlerDetails.cs (3)
17
/// Provides information about an <see cref="
IMethodHandler
"/>.
20
/// <param name="Language">The language this <see cref="
IMethodHandler
"/> targets.</param>
94
throw new InvalidOperationException($"Provided handler type {handlerType.FullName} does not implement {nameof(
IMethodHandler
)}");
QueueItem.cs (3)
86
public async Task<(TRequestContext, TRequest)?> CreateRequestContextAsync<TRequest>(
IMethodHandler
handler, RequestHandlerMetadata requestHandlerMetadata, AbstractLanguageServer<TRequestContext> languageServer, CancellationToken cancellationToken)
162
public async Task StartRequestAsync<TRequest, TResponse>(TRequest request, TRequestContext? context,
IMethodHandler
handler, string language, CancellationToken cancellationToken)
217
throw new NotImplementedException($"Unrecognized {nameof(
IMethodHandler
)} implementation {handler.GetType()}.");
RequestExecutionQueue.cs (9)
78
private readonly FrozenDictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata Metadata,
IMethodHandler
Handler, MethodInfo MethodInfo)>>> _handlerInfoMap;
96
private static FrozenDictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata,
IMethodHandler
, MethodInfo)>>> BuildHandlerMap(AbstractHandlerProvider handlerProvider, AbstractTypeRefResolver typeRefResolver)
98
var genericMethodMap = new Dictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata,
IMethodHandler
, MethodInfo)>>>();
105
var languages = new Dictionary<string, Lazy<(RequestHandlerMetadata,
IMethodHandler
, MethodInfo)>>();
118
var
handler = handlerProvider.GetMethodHandler(metadata.MethodName, metadata.RequestTypeRef, metadata.ResponseTypeRef, metadata.Language);
301
/// Reflection invokes <see cref="ProcessQueueCoreAsync{TRequest, TResponse}(IQueueItem{TRequestContext},
IMethodHandler
, RequestHandlerMetadata, ConcurrentDictionary{Task, CancellationTokenSource}, CancellationTokenSource?, CancellationToken)"/>
307
IMethodHandler
handler,
329
IMethodHandler
handler,
411
private (RequestHandlerMetadata Metadata,
IMethodHandler
Handler, MethodInfo MethodInfo) GetHandlerForRequest(IQueueItem<TRequestContext> work, string language)