public OmniSharpCodeActionHandler( Mef.IRequestHandler <GetCodeActionsRequest, GetCodeActionsResponse> getActionsHandler, Mef.IRequestHandler <RunCodeActionRequest, RunCodeActionResponse> runActionHandler, DocumentSelector documentSelector, ISerializer serializer, ILanguageServer server, DocumentVersions documentVersions) : base(new CodeActionRegistrationOptions() { DocumentSelector = documentSelector, CodeActionKinds = new Container <CodeActionKind>( CodeActionKind.SourceOrganizeImports, CodeActionKind.Refactor, CodeActionKind.RefactorExtract), }) { _getActionsHandler = getActionsHandler; _runActionHandler = runActionHandler; _serializer = serializer; _server = server; _documentVersions = documentVersions; _executeCommandRegistrationOptions = new ExecuteCommandRegistrationOptions() { Commands = new Container <string>("omnisharp/executeCodeAction"), }; }
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)); } }
public static IEnumerable <IJsonRpcHandler> Enumerate( RequestHandlers handlers, OmniSharpWorkspace workspace, DocumentVersions documentVersions) { foreach (var(selector, openHandler, closeHandler, bufferHandler) in handlers .OfType < Mef.IRequestHandler <FileOpenRequest, FileOpenResponse>, Mef.IRequestHandler <FileCloseRequest, FileCloseResponse>, Mef.IRequestHandler <UpdateBufferRequest, object> >()) { var documentSyncKind = TextDocumentSyncKind.Incremental; //if (selector.ToString().IndexOf(".cake") > -1) documentSyncKind = TextDocumentSyncKind.Full; yield return(new OmniSharpTextDocumentSyncHandler(openHandler, closeHandler, bufferHandler, selector, documentSyncKind, workspace, documentVersions)); } }
public OmniSharpTextDocumentSyncHandler( Mef.IRequestHandler <FileOpenRequest, FileOpenResponse> openHandler, Mef.IRequestHandler <FileCloseRequest, FileCloseResponse> closeHandler, Mef.IRequestHandler <UpdateBufferRequest, object> bufferHandler, DocumentSelector documentSelector, TextDocumentSyncKind documentSyncKind, OmniSharpWorkspace workspace, DocumentVersions documentVersions) { _openHandler = openHandler; _closeHandler = closeHandler; _bufferHandler = bufferHandler; _documentSelector = documentSelector; _documentSyncKind = documentSyncKind; _workspace = workspace; _documentVersions = documentVersions; }
public OmniSharpCodeActionHandler( Mef.IRequestHandler<GetCodeActionsRequest, GetCodeActionsResponse> getActionsHandler, Mef.IRequestHandler<RunCodeActionRequest, RunCodeActionResponse> runActionHandler, DocumentSelector documentSelector, ISerializer serializer, ILanguageServer server, DocumentVersions documentVersions) { _getActionsHandler = getActionsHandler; _runActionHandler = runActionHandler; _documentSelector = documentSelector; _serializer = serializer; _server = server; _documentVersions = documentVersions; _executeCommandRegistrationOptions = new ExecuteCommandRegistrationOptions() { Commands = new Container<string>("omnisharp/executeCodeAction"), }; }
public OmniSharpTextDocumentSyncHandler( Mef.IRequestHandler <FileOpenRequest, FileOpenResponse> openHandler, Mef.IRequestHandler <FileCloseRequest, FileCloseResponse> closeHandler, Mef.IRequestHandler <UpdateBufferRequest, object> bufferHandler, DocumentSelector documentSelector, TextDocumentSyncKind documentSyncKind, OmniSharpWorkspace workspace, DocumentVersions documentVersions) : base(documentSyncKind, new TextDocumentSaveRegistrationOptions() { DocumentSelector = documentSelector, IncludeText = true, }) { _openHandler = openHandler; _closeHandler = closeHandler; _bufferHandler = bufferHandler; _workspace = workspace; _documentVersions = documentVersions; }