Procházet zdrojové kódy

Remove the launch command

Jeremy Tuloup před 5 roky
rodič
revize
1de0b2e53f
3 změnil soubory, kde provedl 4 přidání a 42 odebrání
  1. 4 20
      src/index.ts
  2. 0 17
      src/service.ts
  3. 0 5
      src/tokens.ts

+ 4 - 20
src/index.ts

@@ -2,10 +2,10 @@
 // Distributed under the terms of the Modified BSD License.
 
 import {
+  ILabShell,
   ILayoutRestorer,
   JupyterFrontEnd,
-  JupyterFrontEndPlugin,
-  ILabShell
+  JupyterFrontEndPlugin
 } from '@jupyterlab/application';
 
 import {
@@ -17,11 +17,11 @@ import {
 
 import { IEditorServices } from '@jupyterlab/codeeditor';
 
-import { IConsoleTracker, ConsolePanel } from '@jupyterlab/console';
+import { ConsolePanel, IConsoleTracker } from '@jupyterlab/console';
 
 import { IStateDB } from '@jupyterlab/coreutils';
 
-import { IEditorTracker, FileEditor } from '@jupyterlab/fileeditor';
+import { FileEditor, IEditorTracker } from '@jupyterlab/fileeditor';
 
 import { INotebookTracker, NotebookPanel } from '@jupyterlab/notebook';
 
@@ -242,10 +242,6 @@ const main: JupyterFrontEndPlugin<IDebugger> = {
 
     let widget: MainAreaWidget<Debugger>;
 
-    const getModel = () => {
-      return tracker.currentWidget ? tracker.currentWidget.content.model : null;
-    };
-
     commands.addCommand(CommandIDs.mount, {
       execute: args => {
         if (!widget) {
@@ -337,18 +333,6 @@ const main: JupyterFrontEndPlugin<IDebugger> = {
       }
     });
 
-    commands.addCommand(CommandIDs.debugNotebook, {
-      label: 'Launch',
-      isEnabled: () => {
-        return service.isStarted();
-      },
-      execute: async () => {
-        await tracker.currentWidget.content.service.launch(
-          getModel().codeValue.text
-        );
-      }
-    });
-
     commands.addCommand(CommandIDs.changeMode, {
       label: 'Change Mode',
       isEnabled: () => {

+ 0 - 17
src/service.ts

@@ -128,23 +128,6 @@ export class DebugService implements IDebugger {
     return this._eventMessage;
   }
 
-  // this will change for after execute cell
-  async launch(code: string): Promise<void> {
-    this.frames = [];
-
-    const breakpoints: DebugProtocol.SourceBreakpoint[] = this.getBreakpoints();
-    const dumpedCell = await this.session.sendRequest('dumpCell', {
-      code
-    });
-
-    await this.setBreakpoints(breakpoints, dumpedCell.body.sourcePath);
-    await this.session.sendRequest('configurationDone', {});
-
-    this.session.client.kernel.requestExecute({ code });
-
-    await this.getAllFrames();
-  }
-
   getAllFrames = async () => {
     const stackFrames = await this.getFrames(this.currentThread());
 

+ 0 - 5
src/tokens.ts

@@ -86,11 +86,6 @@ export interface IDebugger {
    * Signal emitted for debug event messages.
    */
   eventMessage: ISignal<IDebugger, IDebugger.ISession.Event>;
-
-  /**
-   * For testing purpose only, to be removed.
-   */
-  launch(code: string): Promise<void>;
 }
 
 /**