/** Gets the completions at the passed offset. */
    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();
      }
      return EMPTY_COMPLETION_PROPOSALS;
    }
Beispiel #2
0
 /**
  * This method is called when some value has to be changed to some other expression.
  *
  * <p>Note that it will (currently) only work for changing local values that are in the topmost
  * frame. -- python has no way of making it work right now (see: pydevd_vars.changeAttrExpression)
  */
 public void setValue(String expression) throws DebugException {
   ChangeVariableCommand changeVariableCommand = getChangeVariableCommand(target, expression);
   target.postCommand(changeVariableCommand);
   this.value = expression;
   target.fireEvent(new DebugEvent(this, DebugEvent.CONTENT | DebugEvent.CHANGE));
 }