mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 08:51:02 +07:00
PY-34398 Stop debug session after cell execution and save cell ids between debug sessions (IDEA-CR-44654 )
This commit is contained in:
@@ -39,7 +39,10 @@ public interface IPyDebugProcess extends PyFrameAccessor {
|
||||
|
||||
void consoleInputRequested(boolean isStarted);
|
||||
|
||||
@Deprecated
|
||||
void showCythonWarning();
|
||||
|
||||
void showWarning(String warningId);
|
||||
|
||||
XDebugSession getSession();
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public abstract class AbstractCommand<T> {
|
||||
public static final int INPUT_REQUESTED = 147;
|
||||
|
||||
public static final int PROCESS_CREATED = 149;
|
||||
public static final int SHOW_CYTHON_WARNING = 150;
|
||||
public static final int SHOW_WARNING = 150;
|
||||
public static final int LOAD_FULL_VALUE = 151;
|
||||
|
||||
/**
|
||||
@@ -242,7 +242,7 @@ public abstract class AbstractCommand<T> {
|
||||
}
|
||||
|
||||
public static boolean isShowWarningCommand(final int command) {
|
||||
return command == SHOW_CYTHON_WARNING;
|
||||
return command == SHOW_WARNING;
|
||||
}
|
||||
|
||||
public static boolean isExitEvent(final int command) {
|
||||
|
||||
@@ -397,6 +397,12 @@ public class ProtocolParser {
|
||||
return values;
|
||||
}
|
||||
|
||||
public static String parseWarning(final String text) throws PyDebuggerException {
|
||||
final XppReader reader = openReader(text, true);
|
||||
reader.moveDown();
|
||||
return readString(reader, "id", null);
|
||||
}
|
||||
|
||||
private static XppReader openReader(final String text, final boolean checkForContent) throws PyDebuggerException {
|
||||
final XppReader reader = new XppReader(new StringReader(text), new MXParser(), new NoNameCoder());
|
||||
if (checkForContent && !reader.hasMoreChildren()) {
|
||||
|
||||
@@ -549,7 +549,8 @@ public class RemoteDebugger implements ProcessDebugger {
|
||||
onProcessCreatedEvent(frame.getSequence());
|
||||
}
|
||||
else if (AbstractCommand.isShowWarningCommand(frame.getCommand())) {
|
||||
myDebugProcess.showCythonWarning();
|
||||
final String warningId = ProtocolParser.parseWarning(frame.getPayload());
|
||||
myDebugProcess.showWarning(warningId);
|
||||
}
|
||||
else {
|
||||
placeResponse(frame.getSequence(), frame);
|
||||
|
||||
Reference in New Issue
Block a user