Sfoglia il codice sorgente

Extended restriction of sidebar panels to include Widgets

Maciej Nowacki 4 anni fa
parent
commit
37f9db5408
2 ha cambiato i file con 13 aggiunte e 13 eliminazioni
  1. 9 9
      packages/debugger/src/sidebar.ts
  2. 4 4
      packages/debugger/src/tokens.ts

+ 9 - 9
packages/debugger/src/sidebar.ts

@@ -93,34 +93,34 @@ export class DebuggerSidebar extends Panel implements IDebugger.ISidebar {
   /**
    * Add a panel at the end of the sidebar.
    *
-   * @param panel - The panel to add to the sidebar.
+   * @param widget - The widget to add to the sidebar.
    *
    * #### Notes
    * If the widget is already contained in the sidebar, it will be moved.
    */
-  addPanel(panel: Panel) {
-    this.body.addWidget(panel);
+  addPanel(widget: Widget) {
+    this.body.addWidget(widget);
   }
 
   /**
    * Insert a panel at the specified index.
    *
-   * @param index - The index at which to insert the panel.
+   * @param index - The index at which to insert the widget.
    *
-   * @param panel - The panel to insert into to the sidebar.
+   * @param widget - The widget to insert into to the sidebar.
    *
    * #### Notes
    * If the widget is already contained in the sidebar, it will be moved.
    */
-  insertPanel(index: number, panel: Panel) {
-    this.body.insertWidget(index, panel);
+  insertPanel(index: number, widget: Widget) {
+    this.body.insertWidget(index, widget);
   }
 
   /**
    * A read-only array of the sidebar panels.
    */
-  get panels(): Panel[] {
-    return this.body.widgets as Panel[];
+  get panels(): readonly Widget[] {
+    return this.body.widgets;
   }
 
   /**

+ 4 - 4
packages/debugger/src/tokens.ts

@@ -11,7 +11,7 @@ import { IObservableDisposable } from '@lumino/disposable';
 
 import { ISignal, Signal } from '@lumino/signaling';
 
-import { Panel } from '@lumino/widgets';
+import { Widget } from '@lumino/widgets';
 
 import { DebugProtocol } from 'vscode-debugprotocol';
 
@@ -493,17 +493,17 @@ export namespace IDebugger {
     /**
      * Add panel at the end of the sidebar.
      */
-    addPanel(panel: Panel): void;
+    addPanel(widget: Widget): void;
 
     /**
      * Insert panel at a specified index.
      */
-    insertPanel(index: number, panel: Panel): void;
+    insertPanel(index: number, widget: Widget): void;
 
     /**
      * Return all panels that were added to sidebar.
      */
-    readonly panels: Panel[];
+    readonly panels: readonly Widget[];
   }
 
   /**