public static IEnumerable <IJsonRpcHandler> Enumerate(RequestHandlers handlers)
 {
     foreach (var(selector, getActionsHandler, runActionHandler) in handlers
              .OfType <Mef.IRequestHandler <GetCodeActionsRequest, GetCodeActionsResponse>,
                       Mef.IRequestHandler <RunCodeActionRequest, RunCodeActionResponse> >())
     {
         yield return(new OmniSharpCodeActionHandler(getActionsHandler, runActionHandler, selector));
     }
 }
 public static IEnumerable <IJsonRpcHandler> Enumerate(RequestHandlers handlers)
 {
     foreach (var(selector, handler) in handlers.OfType <Mef.IRequestHandler <GotoDefinitionRequest, GotoDefinitionResponse> >())
     {
         if (handler != null)
         {
             yield return(new DefinitionHandler(handler, selector));
         }
     }
 }
 public static IEnumerable <IJsonRpcHandler> Enumerate(RequestHandlers handlers)
 {
     foreach (var(selector, membersAsTreeHandler, findUsagesHandler) in handlers
              .OfType <
                  Mef.IRequestHandler <MembersTreeRequest, FileMemberTree>,
                  Mef.IRequestHandler <FindUsagesRequest, QuickFixResponse> >())
     {
         yield return(new OmniSharpCodeLensHandler(membersAsTreeHandler, findUsagesHandler, selector));
     }
 }
 public static IEnumerable <IJsonRpcHandler> Enumerate(RequestHandlers handlers)
 {
     foreach (var(selector, handler) in handlers
              .OfType <Mef.IRequestHandler <CodeStructureRequest, CodeStructureResponse> >())
     {
         if (handler != null)
         {
             yield return(new OmniSharpDocumentSymbolHandler(handler, selector));
         }
     }
 }
 public static IEnumerable <IJsonRpcHandler> Enumerate(RequestHandlers handlers)
 {
     foreach (var(selector, handler) in handlers
              .OfType <Mef.IRequestHandler <FindImplementationsRequest, QuickFixResponse> >())
     {
         if (handler != null)
         {
             yield return(new OmniSharpImplementationHandler(handler, selector));
         }
     }
 }
Esempio n. 6
0
 public static IEnumerable <IJsonRpcHandler> Enumerate(RequestHandlers handlers)
 {
     foreach (var(selector, handler) in handlers
              .OfType <Mef.IRequestHandler <SignatureHelpRequest, SignatureHelpResponse> >())
     {
         if (handler != null)
         {
             yield return(new SignatureHelpHandler(handler, selector));
         }
     }
 }
Esempio n. 7
0
 public static IEnumerable <IJsonRpcHandler> Enumerate(RequestHandlers handlers)
 {
     foreach (var(selector, handler) in handlers
              .OfType <Mef.IRequestHandler <AutoCompleteRequest, IEnumerable <AutoCompleteResponse> > >())
     {
         if (handler != null)
         {
             yield return(new OmniSharpCompletionHandler(handler, selector));
         }
     }
 }
 public static IEnumerable <IJsonRpcHandler> Enumerate(RequestHandlers handlers)
 {
     foreach (var(selector, handler) in handlers
              .OfType <Mef.IRequestHandler <FormatAfterKeystrokeRequest, FormatRangeResponse> >())
     {
         if (handler != null)
         {
             yield return(new OmniSharpDocumentOnTypeFormattingHandler(handler, selector));
         }
     }
 }
 public static IEnumerable <IJsonRpcHandler> Enumerate(RequestHandlers handlers)
 {
     foreach (var(selector, handler) in handlers
              .OfType <Mef.IRequestHandler <TypeLookupRequest, TypeLookupResponse> >())
     {
         if (handler != null)
         {
             yield return(new OmniSharpHoverHandler(handler, selector));
         }
     }
 }
 public static IEnumerable <IJsonRpcHandler> Enumerate(RequestHandlers handlers)
 {
     foreach (var(selector, handler) in handlers
              .OfType <Mef.IRequestHandler <MembersTreeRequest, FileMemberTree> >())
     {
         if (handler != null)
         {
             yield return(new DocumentSymbolHandler(handler, selector));
         }
     }
 }
Esempio n. 11
0
 public static IEnumerable <IJsonRpcHandler> Enumerate(RequestHandlers handlers)
 {
     foreach (var(selector, handler) in handlers
              .OfType <Mef.IRequestHandler <FindUsagesRequest, QuickFixResponse> >())
     {
         if (handler != null)
         {
             yield return(new ReferencesHandler(handler, selector));
         }
     }
 }
Esempio n. 12
0
 public static IEnumerable <IJsonRpcHandler> Enumerate(RequestHandlers handlers)
 {
     //
     // TODO: remove the conditional when we upgrade to v0.16.0 of Omnisharp.Extensions.LSP
     //
     // we have no WorkspaceSymbolRegistrationOptions/DocumentSelector until version 0.16.0 of Omnisharp.Extensions.LSP
     // thus we artificially limit the handler to C# language for now
     // (as Cake version of <FindSymbolsRequest,QuickFixResponse> would get selected otherwise)
     //
     yield return(new OmniSharpWorkspaceSymbolsHandler(handlers
                                                       .OfType <Mef.IRequestHandler <FindSymbolsRequest, QuickFixResponse> >()
                                                       .Select(z => z.handler)));
 }
 public static IEnumerable <IJsonRpcHandler> Enumerate(
     RequestHandlers handlers,
     ISerializer serializer,
     ILanguageServer mediator,
     DocumentVersions versions)
 {
     foreach (var(selector, getActionsHandler, runActionHandler) in handlers
              .OfType <Mef.IRequestHandler <GetCodeActionsRequest, GetCodeActionsResponse>,
                       Mef.IRequestHandler <RunCodeActionRequest, RunCodeActionResponse> >())
     {
         yield return(new OmniSharpCodeActionHandler(getActionsHandler, runActionHandler, selector, serializer, mediator, versions));
     }
 }
Esempio n. 14
0
 public static IEnumerable <IJsonRpcHandler> Enumerate(
     RequestHandlers handlers,
     OmniSharpWorkspace workspace)
 {
     foreach (var(selector, openHandler, closeHandler, bufferHandler) in handlers
              .OfType <
                  Mef.IRequestHandler <FileOpenRequest, FileOpenResponse>,
                  Mef.IRequestHandler <FileCloseRequest, FileCloseResponse>,
                  Mef.IRequestHandler <UpdateBufferRequest, object> >())
     {
         // TODO: Fix once cake has working support for incremental
         var documentSyncKind = TextDocumentSyncKind.Incremental;
         // if (selector.ToString().IndexOf(".cake") > -1) documentSyncKind = TextDocumentSyncKind.Full;
         yield return(new TextDocumentSyncHandler(openHandler, closeHandler, bufferHandler, selector, documentSyncKind, workspace));
     }
 }