forked from consulo/consulo-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChangeVariableCommand.java
More file actions
40 lines (33 loc) · 1.28 KB
/
Copy pathChangeVariableCommand.java
File metadata and controls
40 lines (33 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.jetbrains.python.debugger.pydev;
import com.jetbrains.python.debugger.IPyDebugProcess;
import com.jetbrains.python.debugger.PyDebugValue;
import com.jetbrains.python.debugger.PyDebuggerException;
public class ChangeVariableCommand extends AbstractFrameCommand {
private final String myVariableName;
private final String myValue;
private PyDebugValue myNewValue = null;
private final IPyDebugProcess myDebugProcess;
public ChangeVariableCommand(RemoteDebugger debugger, String threadId, String frameId, String variableName, String value) {
super(debugger, CHANGE_VARIABLE, threadId, frameId);
myVariableName = variableName;
myValue = value;
myDebugProcess = debugger.getDebugProcess();
}
@Override
protected void buildPayload(Payload payload) {
super.buildPayload(payload);
payload.add("FRAME").add(myVariableName).add(ProtocolParser.encodeExpression(myValue));
}
@Override
public boolean isResponseExpected() {
return true;
}
@Override
protected void processResponse(ProtocolFrame response) throws PyDebuggerException {
super.processResponse(response);
myNewValue = ProtocolParser.parseValue(response.getPayload(), myDebugProcess).setName(myVariableName);
}
public PyDebugValue getNewValue() {
return myNewValue;
}
}