|
@@ -64,7 +64,7 @@ const consoles: JupyterFrontEndPlugin<void> = {
|
|
|
autoStart: true,
|
|
|
requires: [IDebugger, IConsoleTracker, ILabShell],
|
|
|
activate: (
|
|
|
- _,
|
|
|
+ app: JupyterFrontEnd,
|
|
|
debug: IDebugger,
|
|
|
tracker: IConsoleTracker,
|
|
|
labShell: ILabShell
|
|
@@ -74,7 +74,7 @@ const consoles: JupyterFrontEndPlugin<void> = {
|
|
|
handler: DebuggerConsoleHandler;
|
|
|
};
|
|
|
|
|
|
- labShell.currentChanged.connect((_, update) => {
|
|
|
+ labShell.currentChanged.connect(async (_, update) => {
|
|
|
const widget = update.newValue;
|
|
|
|
|
|
if (!(widget instanceof ConsolePanel)) {
|
|
@@ -86,6 +86,10 @@ const consoles: JupyterFrontEndPlugin<void> = {
|
|
|
} else {
|
|
|
debug.session.client = widget.session;
|
|
|
}
|
|
|
+ if (debug.session) {
|
|
|
+ await debug.session.restoreState();
|
|
|
+ app.commands.notifyCommandChanged();
|
|
|
+ }
|
|
|
if (debug.tracker.currentWidget) {
|
|
|
const handler = new DebuggerConsoleHandler({
|
|
|
consoleTracker: tracker,
|
|
@@ -163,7 +167,7 @@ const notebooks: JupyterFrontEndPlugin<void> = {
|
|
|
autoStart: true,
|
|
|
requires: [IDebugger, INotebookTracker, ILabShell],
|
|
|
activate: (
|
|
|
- _,
|
|
|
+ app: JupyterFrontEnd,
|
|
|
debug: IDebugger,
|
|
|
tracker: INotebookTracker,
|
|
|
labShell: ILabShell
|
|
@@ -173,7 +177,7 @@ const notebooks: JupyterFrontEndPlugin<void> = {
|
|
|
handler: DebuggerNotebookHandler;
|
|
|
};
|
|
|
|
|
|
- labShell.currentChanged.connect((_, update) => {
|
|
|
+ labShell.currentChanged.connect(async (_, update) => {
|
|
|
const widget = update.newValue;
|
|
|
if (!(widget instanceof NotebookPanel)) {
|
|
|
return;
|
|
@@ -183,6 +187,10 @@ const notebooks: JupyterFrontEndPlugin<void> = {
|
|
|
} else {
|
|
|
debug.session.client = widget.session;
|
|
|
}
|
|
|
+ if (debug.session) {
|
|
|
+ await debug.session.restoreState();
|
|
|
+ app.commands.notifyCommandChanged();
|
|
|
+ }
|
|
|
if (debug.tracker.currentWidget) {
|
|
|
const handler = new DebuggerNotebookHandler({
|
|
|
notebookTracker: tracker,
|
|
@@ -253,16 +261,13 @@ const main: JupyterFrontEndPlugin<IDebugger> = {
|
|
|
sidebar.parent = null;
|
|
|
}
|
|
|
|
|
|
- // edge case when realod page after set condensed mode
|
|
|
+ // edge case when reload page after set condensed mode
|
|
|
widget.title.label = 'Debugger';
|
|
|
shell.add(widget, 'main');
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (sidebar.isAttached) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
+ // mode = 'condensed'
|
|
|
if (widget.isAttached) {
|
|
|
widget.parent = null;
|
|
|
}
|
|
@@ -310,16 +315,9 @@ const main: JupyterFrontEndPlugin<IDebugger> = {
|
|
|
},
|
|
|
execute: () => {
|
|
|
const currentMode = tracker.currentWidget.content.model.mode;
|
|
|
- tracker.currentWidget.content.model.mode =
|
|
|
- currentMode === 'expanded' ? 'condensed' : 'expanded';
|
|
|
- let mode = tracker.currentWidget.content.model.mode;
|
|
|
-
|
|
|
- if (mode === 'condensed') {
|
|
|
- void commands.execute(CommandIDs.mount, { mode });
|
|
|
- } else if (mode === 'expanded') {
|
|
|
- widget.content.sidebar.close();
|
|
|
- void commands.execute(CommandIDs.mount, { mode });
|
|
|
- }
|
|
|
+ const mode = currentMode === 'expanded' ? 'condensed' : 'expanded';
|
|
|
+ tracker.currentWidget.content.model.mode = mode;
|
|
|
+ void commands.execute(CommandIDs.mount, { mode });
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -394,7 +392,7 @@ const main: JupyterFrontEndPlugin<IDebugger> = {
|
|
|
},
|
|
|
session: {
|
|
|
get: (): IDebugger.ISession | null => {
|
|
|
- return null;
|
|
|
+ return widget ? widget.content.model.session : null;
|
|
|
},
|
|
|
set: (src: IDebugger.ISession | null) => {
|
|
|
if (widget) {
|