4 interfaces inheriting from IMethodHandler
Microsoft.CommonLanguageServerProtocol.Framework.Package (4)
INotificationHandler.cs (2)
17internal interface INotificationHandler<TRequestContext> : IMethodHandler 27internal interface INotificationHandler<TRequest, TRequestContext> : IMethodHandler
IRequestHandler.cs (2)
12internal interface IRequestHandler<TRequest, TResponse, TRequestContext> : IMethodHandler 24internal 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. 35public 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> 36public abstract Task<TRequestContext> CreateRequestContextAsync<TRequestParam>(IQueueItem<TRequestContext> queueItem, IMethodHandler methodHandler, TRequestParam requestParam, CancellationToken cancellationToken);
HandlerProvider.cs (12)
21private FrozenDictionary<RequestHandlerMetadata, Lazy<IMethodHandler>>? _requestHandlers; 23public IMethodHandler GetMethodHandler(string method, TypeRef? requestTypeRef, TypeRef? responseTypeRef) 26public override IMethodHandler GetMethodHandler(string method, TypeRef? requestTypeRef, TypeRef? responseTypeRef, string language) 45private FrozenDictionary<RequestHandlerMetadata, Lazy<IMethodHandler>> GetRequestHandlers() 48private static FrozenDictionary<RequestHandlerMetadata, Lazy<IMethodHandler>> CreateMethodToHandlerMap(ILspServices lspServices, AbstractTypeRefResolver typeRefResolver) 50var builder = new Dictionary<RequestHandlerMetadata, Lazy<IMethodHandler>>(); 76var handlers = lspServices.GetRequiredServices<IMethodHandler>(); 78foreach (var handler in handlers) 98static Lazy<IMethodHandler> GetLazyHandlerFromInstance(IMethodHandler instance) 103static Lazy<IMethodHandler> GetLazyHandlerFromTypeRef(ILspServices lspServices, AbstractTypeRefResolver typeRefResolver, TypeRef handlerTypeRef) 115return (IMethodHandler)lspService;
IMethodHandlerProvider.cs (2)
14/// to provide faster access to <see cref="IMethodHandler"/>s. 18ImmutableArray<(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> 29Task 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)"/> 39Task<(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> 94throw new InvalidOperationException($"Provided handler type {handlerType.FullName} does not implement {nameof(IMethodHandler)}");
QueueItem.cs (3)
86public async Task<(TRequestContext, TRequest)?> CreateRequestContextAsync<TRequest>(IMethodHandler handler, RequestHandlerMetadata requestHandlerMetadata, AbstractLanguageServer<TRequestContext> languageServer, CancellationToken cancellationToken) 162public async Task StartRequestAsync<TRequest, TResponse>(TRequest request, TRequestContext? context, IMethodHandler handler, string language, CancellationToken cancellationToken) 217throw new NotImplementedException($"Unrecognized {nameof(IMethodHandler)} implementation {handler.GetType()}.");
RequestExecutionQueue.cs (9)
78private readonly FrozenDictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata Metadata, IMethodHandler Handler, MethodInfo MethodInfo)>>> _handlerInfoMap; 96private static FrozenDictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>> BuildHandlerMap(AbstractHandlerProvider handlerProvider, AbstractTypeRefResolver typeRefResolver) 98var genericMethodMap = new Dictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>>(); 105var languages = new Dictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>(); 118var 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)"/> 307IMethodHandler handler, 329IMethodHandler handler, 411private (RequestHandlerMetadata Metadata, IMethodHandler Handler, MethodInfo MethodInfo) GetHandlerForRequest(IQueueItem<TRequestContext> work, string language)