Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
activate: (
_: JupyterFrontEnd,
statusBar: IStatusBar,
notebookTracker: INotebookTracker,
editorTracker: IEditorTracker,
consoleTracker: IConsoleTracker,
labShell: ILabShell
) => {
const item = new LineCol();
const onActiveCellChanged = (notebook: Notebook, cell: Cell) => {
item.model!.editor = cell && cell.editor;
};
const onPromptCreated = (console: CodeConsole, prompt: CodeCell) => {
item.model!.editor = prompt && prompt.editor;
};
labShell.currentChanged.connect((_, change) => {
const { oldValue, newValue } = change;
// Check if we need to disconnect the console listener
// or the notebook active cell listener
if (oldValue && consoleTracker.has(oldValue)) {
(oldValue as ConsolePanel).console.promptCellCreated.disconnect(
activate: (
_: JupyterFrontEnd,
statusBar: IStatusBar,
notebookTracker: INotebookTracker,
editorTracker: IEditorTracker,
consoleTracker: IConsoleTracker,
labShell: ILabShell
) => {
const item = new LineCol();
const onActiveCellChanged = (notebook: Notebook, cell: Cell) => {
item.model!.editor = cell && cell.editor;
};
const onPromptCreated = (console: CodeConsole, prompt: CodeCell) => {
item.model!.editor = prompt && prompt.editor;
};
labShell.currentChanged.connect((_, change) => {
const { oldValue, newValue } = change;
// Check if we need to disconnect the console listener
// or the notebook active cell listener
if (oldValue && consoleTracker.has(oldValue)) {
(oldValue as ConsolePanel).console.promptCellCreated.disconnect(