public static void ApplyFix(CodeAction action, object context) { if (context is IScriptProvider) { using (var script = ((IScriptProvider)context).CreateScript()) { action.Run(context, script); } } else { action.Run(context, null); } }
public static void ApplyFix(CodeAction action, object context) { var scriptProvider = context as IScriptProvider; if (scriptProvider != null) { using (var script = scriptProvider.CreateScript()) { action.Run(context, script); } } else { action.Run(context, null); } }
public static void ApplyFix(CodeAction action, IRefactoringContext context) { if (!CheckUserSettings()) { return; } using (var script = context.CreateScript()) { action.Run(context, script); } }
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 override void Run(IRefactoringContext context, object script) { act.Run((Script)script); }
public static void ApplyFix(CodeAction action, IRefactoringContext context) { using (var script = context.CreateScript()) { action.Run(context, script); } }