Skip to content

Commit

Permalink
Explicitly create a Panel instance for each ConsolePanel instead of p…
Browse files Browse the repository at this point in the history
…assing it in.
  • Loading branch information
afshin committed Jan 1, 2020
1 parent 70decaf commit 7e4e796
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
3 changes: 1 addition & 2 deletions examples/console/src/index.ts
Expand Up @@ -12,7 +12,7 @@ import '../index.css';

import { CommandRegistry } from '@lumino/commands';

import { CommandPalette, SplitPanel, Widget, Panel } from '@lumino/widgets';
import { CommandPalette, SplitPanel, Widget } from '@lumino/widgets';

import { ServiceManager } from '@jupyterlab/services';

Expand Down Expand Up @@ -70,7 +70,6 @@ function startApp(path: string, manager: ServiceManager.IManager) {
let editorFactory = editorServices.factoryService.newInlineEditor;
let contentFactory = new ConsolePanel.ContentFactory({ editorFactory });
let consolePanel = new ConsolePanel({
content: new Panel(),
rendermime,
manager,
path,
Expand Down
1 change: 0 additions & 1 deletion packages/completer-extension/src/index.ts
Expand Up @@ -140,7 +140,6 @@ const consoles: JupyterFrontEndPlugin<void> = {
const editor = anchor.promptCell?.editor ?? null;
const session = anchor.sessionContext.session;
// TODO: CompletionConnector assumes editor and session are not null

const connector = new CompletionConnector({ session, editor });
const handler = manager.register({ connector, editor, parent: widget });

Expand Down
3 changes: 1 addition & 2 deletions packages/console-extension/src/index.ts
Expand Up @@ -53,7 +53,7 @@ import {

import { DisposableSet } from '@lumino/disposable';

import { DockLayout, Menu, Panel } from '@lumino/widgets';
import { DockLayout, Menu } from '@lumino/widgets';

import foreign from './foreign';

Expand Down Expand Up @@ -249,7 +249,6 @@ async function activateConsole(
await manager.ready;

const panel = new ConsolePanel({
content: new Panel(),
manager,
contentFactory,
mimeTypeService: editorServices.mimeTypeService,
Expand Down
3 changes: 1 addition & 2 deletions packages/console/src/panel.ts
Expand Up @@ -45,7 +45,7 @@ export class ConsolePanel extends MainAreaWidget<Panel> {
* Construct a console panel.
*/
constructor(options: ConsolePanel.IOptions) {
super(options);
super({ content: new Panel() });
this.addClass(PANEL_CLASS);
let {
rendermime,
Expand Down Expand Up @@ -178,7 +178,6 @@ export namespace ConsolePanel {
* The initialization options for a console panel.
*/
export interface IOptions {
content: Panel;
/**
* The rendermime instance used by the panel.
*/
Expand Down
3 changes: 1 addition & 2 deletions tests/test-console/src/panel.spec.ts
Expand Up @@ -7,7 +7,7 @@ import { ServiceManager } from '@jupyterlab/services';

import { Message, MessageLoop } from '@lumino/messaging';

import { Widget, Panel } from '@lumino/widgets';
import { Widget } from '@lumino/widgets';

import { CodeConsole, ConsolePanel } from '@jupyterlab/console';

Expand Down Expand Up @@ -46,7 +46,6 @@ describe('console/panel', () => {

beforeEach(() => {
panel = new TestPanel({
content: new Panel(),
manager,
contentFactory,
rendermime,
Expand Down

0 comments on commit 7e4e796

Please sign in to comment.