Selaa lähdekoodia

set session only in debugger model

Borys Palka 5 vuotta sitten
vanhempi
commit
1baa7f4eed
4 muutettua tiedostoa jossa 5 lisäystä ja 7 poistoa
  1. 1 1
      src/breakpoints/index.ts
  2. 0 3
      src/handlers/console.ts
  3. 4 2
      src/handlers/notebook.ts
  4. 0 1
      src/index.ts

+ 1 - 1
src/breakpoints/index.ts

@@ -148,7 +148,7 @@ export namespace Breakpoints {
         this.breakpoints = [];
       } else {
         const breakpoint = { ...this.breakpoints[0] };
-        var breakpoints: Breakpoints.IBreakpoint[] = [];
+        let breakpoints: Breakpoints.IBreakpoint[] = [];
         linesInfo.forEach(ele => {
           breakpoints.push({ ...breakpoint, line: ele.line + 1 });
         });

+ 0 - 3
src/handlers/console.ts

@@ -44,7 +44,6 @@ export class DebuggerConsoleHandler {
   ) {
     this.consoleSession = consolePanel ? consolePanel.session : null;
     if (this.debuggerModel.session && this.consoleSession) {
-      this.debuggerModel.session.dispose();
       const newSession = new DebugSession({
         client: this.consoleSession as IClientSession
       });
@@ -81,11 +80,9 @@ export class DebuggerConsoleHandler {
       this.debuggerModel.session.id ===
         (this.consoleSession as IClientSession).name
     ) {
-      console.log('?');
       this.cellManager.previousCell = this.cellManager.activeCell;
       this.cellManager.activeCell = update;
     } else if (!this.cellManager) {
-      console.log('??');
       this.cellManager = new CellManager({
         activeCell: update,
         breakpointsModel: this.breakpoints,

+ 4 - 2
src/handlers/notebook.ts

@@ -34,7 +34,6 @@ export class DebuggerNotebookHandler {
 
   private notebookTracker: INotebookTracker;
   private debuggerModel: Debugger.Model;
-  // private debuggerSession: DebugSession;
   private breakpoints: Breakpoints.Model;
   private cellManager: CellManager;
 
@@ -59,7 +58,10 @@ export class DebuggerNotebookHandler {
     note: INotebookTracker
   ) {
     if (this.debuggerModel.session) {
-      this.debuggerModel.session.dispose();
+      const newSession = new DebugSession({
+        client: client as IClientSession
+      });
+      this.debuggerModel.session = newSession;
       note.activeCellChanged.disconnect(this.onNewCell, this);
     }
     if (client) {

+ 0 - 1
src/index.ts

@@ -90,7 +90,6 @@ const files: JupyterFrontEndPlugin<void> = {
       if (session && debug.currentWidget) {
         const debugModel: Debugger.Model = debug.currentWidget.content.model;
         debugModel.session.client = session;
-        console.log(session.name);
         debugModel.sidebar.breakpoints.model.type = session.type as SessionTypes;
       }
     });