public override void DoCommand(object sender, EventArgs args) { var window = ExecuteInReplCommand.EnsureReplWindow(); IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame; ErrorHandler.ThrowOnFailure(windowFrame.Show()); ((IReplWindow)window).Focus(); }
public override void DoCommand(object sender, EventArgs args) { ToolWindowPane window = ExecuteInReplCommand.EnsureReplWindow(); IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame; ErrorHandler.ThrowOnFailure(windowFrame.Show()); var activeView = CommonPackage.GetActiveTextView(); foreach (var span in activeView.Selection.SelectedSpans) { var text = span.GetText(); ((IReplWindow)window).PasteText(text); } ((IReplWindow)window).Focus(); }
public override void DoCommand(object sender, EventArgs args) { var window = ExecuteInReplCommand.EnsureReplWindow(); var eval = window.Evaluator as RemotePythonEvaluator; var activeView = IronPythonToolsPackage.GetActiveTextView(); string path = activeView.GetFilePath(); if (path != null) { var scope = eval.Engine.GetScope(path); if (scope != null) { // we're now in the correct module, execute the code string scopeName = eval.SetScope(scope); window.Cancel(); if (scopeName != String.Empty) { window.WriteLine(eval.Prompt + " %module " + scopeName); window.WriteLine(String.Format("Current scope changed to {0}", scopeName)); } else { window.WriteLine(eval.Prompt + " %module (unknown name)"); window.WriteLine("Current scope changed to (unknown name)"); } base.DoCommand(sender, args); } else { window.WriteLine(String.Format("Could not find module: {0}", path)); } } else { window.WriteLine("Could not find module"); } }
public ExecuteInReplCommand() { Instance = this; }