Package org.python.pydev.debug.model

Examples of org.python.pydev.debug.model.PyStackFrame


     */
    protected static PyStackFrame getCurrentSuspendedPyStackFrame(IConsole console) {
        IAdaptable context = DebugUITools.getDebugContext();

        if (context instanceof PyStackFrame) {
            PyStackFrame stackFrame = (PyStackFrame) context;
            if (!stackFrame.isTerminated() && stackFrame.isSuspended()) {
                if (console != null) {
                    //If a console is passed, we must check if it matches the console from the selected frame.
                    AbstractDebugTarget target = (AbstractDebugTarget) stackFrame.getAdapter(IDebugTarget.class);
                    if (DebugUITools.getConsole(target.getProcess()) != console) {
                        return null;
                    }
                }

View Full Code Here


         */
        public ICompletionProposal[] getCompletions(String text, String actTok, int offset) throws Exception {
            this.text = text;
            this.actTok = actTok;
            this.offset = offset;
            PyStackFrame stackFrame = getCurrentSuspendedPyStackFrame(null);

            if (stackFrame != null) {
                AbstractDebugTarget target = (AbstractDebugTarget) stackFrame.getAdapter(IDebugTarget.class);
                if (target != null) {
                    GetCompletionsCommand cmd = new GetCompletionsCommand(target, actTok, stackFrame.getLocalsLocator()
                            .getPyDBLocation());
                    cmd.setCompletionListener(this);
                    target.postCommand(cmd);
                }
                return waitForCommand();
View Full Code Here

     */
    public static PyStackFrame getCurrentSuspendedPyStackFrame() {
        IAdaptable context = DebugUITools.getDebugContext();

        if (context instanceof PyStackFrame) {
            PyStackFrame stackFrame = (PyStackFrame) context;
            if (!stackFrame.isTerminated() && stackFrame.isSuspended()) {
                return stackFrame;
            }
        }
        return null;
    }
View Full Code Here

    /**
     * Initialize Console Interpreter and Console Communication for the Debug Console
     */
    public static PydevConsoleInterpreter createPydevDebugInterpreter(PydevConsoleLaunchInfo info) throws Exception {

        PyStackFrame frame = info.frame;

        PydevConsoleInterpreter consoleInterpreter = new PydevConsoleInterpreter();
        consoleInterpreter.setFrame(frame);

        // pydev console uses running debugger as a backend
View Full Code Here

            // create a thread that'll keep locked until an answer is received from the server.
            Job job = new Job("PyDev Debug Console Communication") {

                @Override
                protected IStatus run(IProgressMonitor monitor) {
                    PyStackFrame frame = consoleFrame.getLastSelectedFrame();
                    if (frame == null) {
                        nextResponse = new InterpreterResponse(EMPTY,
                                "[Invalid Frame]: Please select frame to connect the console." + "\n", false, false);
                        return Status.CANCEL_STATUS;
                    }
View Full Code Here

        ICompletionProposal[] receivedCompletions = {};
        if (waitingForInput) {
            return new ICompletionProposal[0];
        }

        PyStackFrame frame = consoleFrame.getLastSelectedFrame();
        if (frame == null) {
            return new ICompletionProposal[0];
        }

        final EvaluateDebugConsoleExpression evaluateDebugConsoleExpression = new EvaluateDebugConsoleExpression(frame);
View Full Code Here

    // Initialize the console factory class
    private static final PydevConsoleFactory fFactory = new PydevConsoleFactory();

    public void run(IAction action) {
        try {
            PyStackFrame suspendedFrame = PydevDebugConsoleFrame.getCurrentSuspendedPyStackFrame();
            fFactory.createDebugConsole(suspendedFrame, null);
        } catch (Exception e) {
            ConsolePlugin.log(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.python.pydev.debug.model.PyStackFrame

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.