Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Update to JupyterLab 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Jan 15, 2020
1 parent 793492b commit 7bdf673
Show file tree
Hide file tree
Showing 32 changed files with 207 additions and 214 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,18 @@ conda install -c conda-forge xeus-python=0.6.7 notebook>=6 ptvsd

## Development

The current master branch targets the JupyterLab 2.0 beta release.

```bash
# Create a new conda environment
conda create -n jupyterlab-debugger -c conda-forge jupyterlab nodejs xeus-python=0.6 ptvsd
conda create -n jupyterlab-debugger -c conda-forge nodejs xeus-python=0.6 ptvsd

# Activate the conda environment
conda activate jupyterlab-debugger

# Install JupyterLab 2.0
python -m pip install --pre -U jupyterlab

# Install dependencies
jlpm

Expand Down
33 changes: 17 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,29 @@
"watch": "tsc -b --watch"
},
"dependencies": {
"@jupyterlab/application": "^1.1.0",
"@jupyterlab/apputils": "^1.1.0",
"@jupyterlab/codeeditor": "^1.1.0",
"@jupyterlab/console": "^1.1.0",
"@jupyterlab/coreutils": "^3.1.0",
"@jupyterlab/docregistry": "^1.1.0",
"@jupyterlab/fileeditor": "^1.1.0",
"@jupyterlab/launcher": "^1.1.0",
"@jupyterlab/observables": "^2.4.0",
"@jupyterlab/notebook": "^1.1.0",
"@jupyterlab/services": "^4.1.0",
"@phosphor/algorithm": "^1.2.0",
"@phosphor/coreutils": "^1.3.1",
"@phosphor/disposable": "^1.2.0",
"@phosphor/widgets": "^1.8.0",
"@jupyterlab/application": "^2.0.0-beta.2",
"@jupyterlab/apputils": "^2.0.0-beta.2",
"@jupyterlab/codeeditor": "^2.0.0-beta.2",
"@jupyterlab/console": "^2.0.0-beta.2",
"@jupyterlab/coreutils": "^4.0.0-beta.2",
"@jupyterlab/docregistry": "^2.0.0-beta.2",
"@jupyterlab/fileeditor": "^2.0.0-beta.2",
"@jupyterlab/launcher": "^2.0.0-beta.2",
"@jupyterlab/observables": "^3.0.0-beta.2",
"@jupyterlab/notebook": "^2.0.0-beta.2",
"@jupyterlab/services": "^5.0.0-beta.2",
"@lumino/algorithm": "^1.2.0",
"@lumino/coreutils": "^1.3.1",
"@lumino/disposable": "^1.2.0",
"@lumino/widgets": "^1.8.0",
"murmurhash-js": "^1.0.0",
"react-inspector": "^2.0.0",
"vscode-debugprotocol": "^1.37.0"
},
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"@jupyterlab/testutils": "^1.1.0",
"@jupyterlab/testutils": "^2.0.0-beta.2",
"@types/chai": "^4.1.3",
"@types/codemirror": "0.0.76",
"@types/jest": "^24.0.17",
Expand All @@ -74,6 +74,7 @@
"husky": "^3.0.2",
"jest": "^24.8.0",
"jest-junit": "^6.3.0",
"jest-raw-loader": "^1.0.1",
"lint-staged": "^9.2.1",
"prettier": "^1.19.1",
"rimraf": "~2.6.2",
Expand Down
2 changes: 1 addition & 1 deletion src/breakpoints/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { Toolbar } from '@jupyterlab/apputils';

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

/**
* The header for a Breakpoints Panel.
Expand Down
4 changes: 2 additions & 2 deletions src/breakpoints/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { ToolbarButton } from '@jupyterlab/apputils';

import { Panel } from '@phosphor/widgets';
import { Panel } from '@lumino/widgets';

import { IDebugger } from '../tokens';

Expand Down Expand Up @@ -31,7 +31,7 @@ export class Breakpoints extends Panel {
header.toolbar.addItem(
'closeAll',
new ToolbarButton({
iconClassName: 'jp-CloseAllIcon',
iconClass: 'jp-CloseAllIcon',
onClick: () => {
void service.clearBreakpoints();
},
Expand Down
4 changes: 2 additions & 2 deletions src/breakpoints/model.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { IDisposable } from '@phosphor/disposable';
import { IDisposable } from '@lumino/disposable';

import { ISignal, Signal } from '@phosphor/signaling';
import { ISignal, Signal } from '@lumino/signaling';

import { IDebugger } from '../tokens';

Expand Down
2 changes: 1 addition & 1 deletion src/callstack/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { Toolbar } from '@jupyterlab/apputils';

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

/**
* The header for a Callstack Panel.
Expand Down
4 changes: 2 additions & 2 deletions src/callstack/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import { CommandToolbarButton } from '@jupyterlab/apputils';

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

import { Panel } from '@phosphor/widgets';
import { Panel } from '@lumino/widgets';

import { CallstackBody } from './body';

Expand Down
2 changes: 1 addition & 1 deletion src/callstack/model.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { ISignal, Signal } from '@phosphor/signaling';
import { ISignal, Signal } from '@lumino/signaling';

import { DebugProtocol } from 'vscode-debugprotocol';

Expand Down
2 changes: 1 addition & 1 deletion src/debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { IEditorServices } from '@jupyterlab/codeeditor';

import { SplitPanel } from '@phosphor/widgets';
import { SplitPanel } from '@lumino/widgets';

import { Breakpoints } from './breakpoints';

Expand Down
6 changes: 3 additions & 3 deletions src/handlers/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { Cell, CodeCell } from '@jupyterlab/cells';

import { IObservableMap, ObservableMap } from '@jupyterlab/observables';

import { each } from '@phosphor/algorithm';
import { each } from '@lumino/algorithm';

import { IDisposable } from '@phosphor/disposable';
import { IDisposable } from '@lumino/disposable';

import { Signal } from '@phosphor/signaling';
import { Signal } from '@lumino/signaling';

import { EditorHandler } from '../handlers/editor';

Expand Down
14 changes: 7 additions & 7 deletions src/handlers/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { ActivityMonitor } from '@jupyterlab/coreutils';

import { IObservableString } from '@jupyterlab/observables';

import { IDisposable } from '@phosphor/disposable';
import { IDisposable } from '@lumino/disposable';

import { Signal } from '@phosphor/signaling';
import { Signal } from '@lumino/signaling';

import { Editor } from 'codemirror';

Expand Down Expand Up @@ -40,7 +40,7 @@ export class EditorHandler implements IDisposable {
* @param options The instantiation options for a EditorHandler.
*/
constructor(options: EditorHandler.IOptions) {
this._id = options.debuggerService.session.client.path;
this._id = options.debuggerService.session.connection.path;
this._path = options.path;
this._debuggerService = options.debuggerService;
this._editor = options.editor;
Expand Down Expand Up @@ -151,7 +151,7 @@ export class EditorHandler implements IDisposable {

const breakpoints = this._getBreakpointsFromEditor().map(lineInfo => {
return Private.createBreakpoint(
this._debuggerService.session.client.name,
this._debuggerService.session.connection.name,
lineInfo.line + 1
);
});
Expand All @@ -171,7 +171,7 @@ export class EditorHandler implements IDisposable {
private _onGutterClick = (editor: Editor, lineNumber: number) => {
const info = editor.lineInfo(lineNumber);

if (!info || this._id !== this._debuggerService.session.client.path) {
if (!info || this._id !== this._debuggerService.session.connection.path) {
return;
}

Expand All @@ -182,7 +182,7 @@ export class EditorHandler implements IDisposable {
} else {
breakpoints.push(
Private.createBreakpoint(
this._path ?? this._debuggerService.session.client.name,
this._path ?? this._debuggerService.session.connection.name,
info.line + 1
)
);
Expand All @@ -201,7 +201,7 @@ export class EditorHandler implements IDisposable {
private _addBreakpointsToEditor() {
const editor = this._editor as CodeMirrorEditor;
const breakpoints = this._getBreakpoints();
if (this._id !== this._debuggerService.session.client.path) {
if (this._id !== this._debuggerService.session.connection.path) {
return;
}
EditorHandler.clearGutter(editor);
Expand Down
4 changes: 2 additions & 2 deletions src/handlers/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { DocumentWidget } from '@jupyterlab/docregistry';

import { FileEditor } from '@jupyterlab/fileeditor';

import { IDisposable } from '@phosphor/disposable';
import { IDisposable } from '@lumino/disposable';

import { Signal } from '@phosphor/signaling';
import { Signal } from '@lumino/signaling';

import { EditorHandler } from '../handlers/editor';

Expand Down
4 changes: 2 additions & 2 deletions src/handlers/notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { IObservableMap, ObservableMap } from '@jupyterlab/observables';

import { Notebook, NotebookPanel } from '@jupyterlab/notebook';

import { IDisposable } from '@phosphor/disposable';
import { IDisposable } from '@lumino/disposable';

import { Signal } from '@phosphor/signaling';
import { Signal } from '@lumino/signaling';

import { EditorHandler } from './editor';

Expand Down
20 changes: 10 additions & 10 deletions src/handlers/tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import { IEditorTracker } from '@jupyterlab/fileeditor';

import { INotebookTracker } from '@jupyterlab/notebook';

import { chain, each } from '@phosphor/algorithm';
import { chain, each } from '@lumino/algorithm';

import { Token } from '@phosphor/coreutils';
import { Token } from '@lumino/coreutils';

import { IDisposable } from '@phosphor/disposable';
import { IDisposable } from '@lumino/disposable';

import { Signal } from '@phosphor/signaling';
import { Signal } from '@lumino/signaling';

import { EditorHandler } from './editor';

Expand Down Expand Up @@ -129,7 +129,7 @@ export class TrackerHandler implements IDisposable {
_: CallstackModel,
frame: CallstackModel.IFrame
) {
const debugSessionPath = this._debuggerService.session?.client?.path;
const debugSessionPath = this._debuggerService.session?.connection?.path;
const source = frame?.source.path ?? null;
each(this._find(debugSessionPath, source), editor => {
requestAnimationFrame(() => {
Expand All @@ -147,7 +147,7 @@ export class TrackerHandler implements IDisposable {
if (!source) {
return;
}
const debugSessionPath = this._debuggerService.session.client.path;
const debugSessionPath = this._debuggerService.session.connection.path;
const { content, mimeType, path } = source;
const results = this._find(debugSessionPath, path);
if (results.next()) {
Expand Down Expand Up @@ -210,9 +210,9 @@ export class TrackerHandler implements IDisposable {
}
const editors: CodeEditor.IEditor[] = [];
this._notebookTracker.forEach(notebookPanel => {
const session = notebookPanel.session;
const sessionContext = notebookPanel.sessionContext;

if (session.path !== debugSessionPath) {
if (sessionContext.path !== debugSessionPath) {
return;
}

Expand Down Expand Up @@ -248,9 +248,9 @@ export class TrackerHandler implements IDisposable {
}
const editors: CodeEditor.IEditor[] = [];
this._consoleTracker.forEach(consoleWidget => {
const session = consoleWidget.session;
const sessionContext = consoleWidget.sessionContext;

if (session.path !== debugSessionPath) {
if (sessionContext.path !== debugSessionPath) {
return;
}

Expand Down

0 comments on commit 7bdf673

Please sign in to comment.