4 interfaces inheriting from IMethodHandler
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\INotificationHandler.cs (2)
17internal interface INotificationHandler<TRequestContext> : IMethodHandler 27internal interface INotificationHandler<TRequest, TRequestContext> : IMethodHandler
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\IRequestHandler.cs (2)
12internal interface IRequestHandler<TRequest, TResponse, TRequestContext> : IMethodHandler 24internal interface IRequestHandler<TResponse, TRequestContext> : IMethodHandler
60 references to IMethodHandler
Microsoft.CodeAnalysis.LanguageServer.Protocol (56)
Handler\RequestContext.cs (1)
20/// Context for requests handled by <see cref="IMethodHandler"/>
Handler\RequestContextFactory.cs (2)
22public override Task<RequestContext> CreateRequestContextAsync<TRequestParam>(IQueueItem<RequestContext> queueItem, IMethodHandler methodHandler, TRequestParam requestParam, CancellationToken cancellationToken) 68throw new InvalidOperationException($"{nameof(IMethodHandler)} implementation {methodHandler.GetType()} does not implement {nameof(ISolutionRequiredHandler)}");
LspServices\AbstractExportLspServiceAttribute.cs (2)
51/// If this this service implements <see cref="IMethodHandler"/>, returns a blob of binary data 77_lazyMethodHandlerData = typeof(IMethodHandler).IsAssignableFrom(serviceType)
LspServices\LspServiceMetadataView.cs (1)
24/// Returns an array of request handler method details if this services is an <see cref="IMethodHandler"/>.
LspServices\LspServices.cs (4)
157public ImmutableArray<(IMethodHandler? Instance, TypeRef HandlerTypeRef, ImmutableArray<MethodHandlerDetails> HandlerDetails)> GetMethodHandlers() 159using var _ = ArrayBuilder<(IMethodHandler?, TypeRef, ImmutableArray<MethodHandlerDetails>)>.GetInstance(out var builder); 162foreach (var handler in GetBaseServices<IMethodHandler>())
RoslynLanguageServer.cs (2)
92AddService<IMethodHandler>(new InitializeHandler()); 93AddService<IMethodHandler>(new InitializedHandler());
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\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);
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\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);
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\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;
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\IMethodHandlerProvider.cs (2)
14/// to provide faster access to <see cref="IMethodHandler"/>s. 18ImmutableArray<(IMethodHandler? Instance, TypeRef HandlerTypeRef, ImmutableArray<MethodHandlerDetails> HandlerDetails)> GetMethodHandlers();
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\IQueueItem.cs (4)
23/// <param name="context">The context created by <see cref="CreateRequestContextAsync{TRequest}(IMethodHandler, RequestHandlerMetadata, AbstractLanguageServer{TRequestContext}, CancellationToken)"/>.</param> 28Task StartRequestAsync<TRequest, TResponse>(TRequest request, TRequestContext? context, IMethodHandler handler, string language, CancellationToken cancellationToken); 33/// running the actual request in <see cref="StartRequestAsync{TRequest, TResponse}(TRequest, TRequestContext?, IMethodHandler, string, CancellationToken)"/> 38Task<(TRequestContext, TRequest)?> CreateRequestContextAsync<TRequest>(IMethodHandler handler, RequestHandlerMetadata requestHandlerMetadata, AbstractLanguageServer<TRequestContext> languageServer, CancellationToken cancellationToken);
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\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>
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\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)}");
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\QueueItem.cs (3)
83public async Task<(TRequestContext, TRequest)?> CreateRequestContextAsync<TRequest>(IMethodHandler handler, RequestHandlerMetadata requestHandlerMetadata, AbstractLanguageServer<TRequestContext> languageServer, CancellationToken cancellationToken) 159public async Task StartRequestAsync<TRequest, TResponse>(TRequest request, TRequestContext? context, IMethodHandler handler, string language, CancellationToken cancellationToken) 213throw new NotImplementedException($"Unrecognized {nameof(IMethodHandler)} implementation {handler.GetType()}.");
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (9)
77private readonly FrozenDictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata Metadata, IMethodHandler Handler, MethodInfo MethodInfo)>>> _handlerInfoMap; 95private static FrozenDictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>> BuildHandlerMap(AbstractHandlerProvider handlerProvider, AbstractTypeRefResolver typeRefResolver) 97var genericMethodMap = new Dictionary<string, FrozenDictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>>(); 104var languages = new Dictionary<string, Lazy<(RequestHandlerMetadata, IMethodHandler, MethodInfo)>>(); 117var handler = handlerProvider.GetMethodHandler(metadata.MethodName, metadata.RequestTypeRef, metadata.ResponseTypeRef, metadata.Language); 283/// Reflection invokes <see cref="ProcessQueueCoreAsync{TRequest, TResponse}(IQueueItem{TRequestContext}, IMethodHandler, RequestHandlerMetadata, ConcurrentDictionary{Task, CancellationTokenSource}, CancellationTokenSource?, CancellationToken)"/> 289IMethodHandler handler, 311IMethodHandler handler, 393private (RequestHandlerMetadata Metadata, IMethodHandler Handler, MethodInfo MethodInfo) GetHandlerForRequest(IQueueItem<TRequestContext> work, string language)
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (4)
HandlerProviderTests.cs (4)
19var methodHandler = handlerProvider.GetMethodHandler(TestMethodHandler.Name, TestMethodHandler.RequestType, TestMethodHandler.ResponseType, LanguageServerConstants.DefaultLanguageName); 28var methodHandler = handlerProvider.GetMethodHandler(TestParameterlessMethodHandler.Name, requestTypeRef: null, TestParameterlessMethodHandler.ResponseTypeRef, LanguageServerConstants.DefaultLanguageName); 37var methodHandler = handlerProvider.GetMethodHandler(TestNotificationHandler.Name, TestNotificationHandler.RequestTypeRef, responseTypeRef: null, LanguageServerConstants.DefaultLanguageName); 46var methodHandler = handlerProvider.GetMethodHandler(TestParameterlessNotificationHandler.Name, requestTypeRef: null, responseTypeRef: null, LanguageServerConstants.DefaultLanguageName);