public RunCodeActionsResponse RunCodeAction(CodeActionRequest req) { var actions = GetContextualCodeActions(req).ToList(); if(req.CodeAction > actions.Count) return new RunCodeActionsResponse(); var context = OmniSharpRefactoringContext.GetContext(_bufferParser, req); using (var script = new OmniSharpScript(context, _config)) { CodeAction action = actions[req.CodeAction]; action.Run(script); } return new RunCodeActionsResponse {Text = context.Document.Text}; }
public RunCodeActionsResponse RunCodeAction(CodeActionRequest req) { var actions = GetContextualCodeActions(req).ToList(); if (req.CodeAction > actions.Count) { return(new RunCodeActionsResponse()); } var context = OmniSharpRefactoringContext.GetContext(_bufferParser, req); using (var script = new OmniSharpScript(context, _config)) { CodeAction action = actions[req.CodeAction]; action.Run(script); } return(new RunCodeActionsResponse { Text = context.Document.Text }); }