Exemplo n.º 1
0
        public Task <ExecutionResult> Execute(IReplWindow window, string arguments)
        {
            var eval = window.Evaluator as PythonReplEvaluator;

            if (eval != null)
            {
                if (eval.AttachEnabled)
                {
                    string error = eval.AttachDebugger();
                    if (error != null)
                    {
                        window.WriteError("Failed to attach: " + error);
                    }
                }
                else
                {
                    window.WriteError(
                        "Attaching to an interactive window requires enabling attach " +
                        "support in Tools->Options->Python Tools->Interactive Windows." +
                        Environment.NewLine + Environment.NewLine +
                        "This will cause the debugger to track necessary state to enable " +
                        "debugging until the attach is requested.  Once enabled the " +
                        "interactive window will need to be reset for the change to take " +
                        "effect.");
                }
            }
            else
            {
                window.WriteError("attach only supports Python interactive windows");
            }

            return(ExecutionResult.Succeeded);
        }
Exemplo n.º 2
0
        public Task <ExecutionResult> Initialize(IReplWindow window)
        {
            _window = window;
            _window.SetSmartUpDown(CurrentOptions.ReplSmartHistory);
#if !DEV14_OR_LATER
            _window.SetOptionValue(ReplOptions.CommandPrefix, "$");
            _window.SetOptionValue(ReplOptions.PrimaryPrompt, CurrentOptions.PrimaryPrompt);
            _window.SetOptionValue(ReplOptions.SecondaryPrompt, CurrentOptions.SecondaryPrompt);
            _window.SetOptionValue(ReplOptions.DisplayPromptInMargin, !CurrentOptions.InlinePrompts);
            _window.SetOptionValue(ReplOptions.SupportAnsiColors, true);
            _window.SetOptionValue(ReplOptions.FormattedPrompts, true);
#endif
            _window.WriteLine("Python debug interactive window.  Type $help for a list of commands.");

            _window.TextView.BufferGraph.GraphBuffersChanged += BufferGraphGraphBuffersChanged;
            _window.ReadyForInput += new Action(OnReadyForInput);
            return(ExecutionResult.Succeeded);
        }
Exemplo n.º 3
0
        public Task<ExecutionResult> Execute(IReplWindow window, string arguments) {
            var eval = window.Evaluator as PythonReplEvaluator;
            if (eval != null) {
                if (eval.AttachEnabled) {
                    string error = eval.AttachDebugger();
                    if (error != null) {
                        window.WriteError("Failed to attach: " + error);
                    }
                } else {
                    window.WriteError(
"Attaching to an interactive window requires enabling attach " +
"support in Tools->Options->Python Tools->Interactive Windows." +
Environment.NewLine + Environment.NewLine +
"This will cause the debugger to track necessary state to enable " +
"debugging until the attach is requested.  Once enabled the " +
"interactive window will need to be reset for the change to take " +
"effect.");
                }
            } else {
                window.WriteError("attach only supports Python interactive windows");
            }

            return ExecutionResult.Succeeded;
        }
Exemplo n.º 4
0
        public Task<ExecutionResult> Initialize(IReplWindow window) {            
            _window = window;
            _window.SetOptionValue(ReplOptions.CommandPrefix, "$");

            window.SetOptionValue(ReplOptions.UseSmartUpDown, CurrentOptions.ReplSmartHistory);
            UpdatePrompts(true);
            window.SetOptionValue(ReplOptions.DisplayPromptInMargin, !CurrentOptions.InlinePrompts);
            window.SetOptionValue(ReplOptions.SupportAnsiColors, true);
            window.SetOptionValue(ReplOptions.FormattedPrompts, true);

            WriteInitializationMessage();

            _window.TextView.BufferGraph.GraphBuffersChanged += BufferGraphGraphBuffersChanged;
            return ExecutionResult.Succeeded;
        }
Exemplo n.º 5
0
        public Task<ExecutionResult> Initialize(IReplWindow window) {
            _window = window;
            _window.SetSmartUpDown(CurrentOptions.ReplSmartHistory);
#if !DEV14_OR_LATER
            _window.SetOptionValue(ReplOptions.CommandPrefix, "$");
            _window.SetOptionValue(ReplOptions.PrimaryPrompt, CurrentOptions.PrimaryPrompt);
            _window.SetOptionValue(ReplOptions.SecondaryPrompt, CurrentOptions.SecondaryPrompt);
            _window.SetOptionValue(ReplOptions.DisplayPromptInMargin, !CurrentOptions.InlinePrompts);
            _window.SetOptionValue(ReplOptions.SupportAnsiColors, true);
            _window.SetOptionValue(ReplOptions.FormattedPrompts, true);
#endif
            _window.WriteLine("Python debug interactive window.  Type $help for a list of commands.");

            _window.TextView.BufferGraph.GraphBuffersChanged += BufferGraphGraphBuffersChanged;
            _window.ReadyForInput += new Action(OnReadyForInput);
            return ExecutionResult.Succeeded;
        }