From a1bbabc622cf24ef0d96dfa0266def683e6a102e Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Mon, 28 Oct 2019 13:55:54 -0700 Subject: [PATCH] re-Enable feature --- .../datascience/jupyter/jupyterDebugger.ts | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/client/datascience/jupyter/jupyterDebugger.ts b/src/client/datascience/jupyter/jupyterDebugger.ts index 56afb727606e..120836fbd609 100644 --- a/src/client/datascience/jupyter/jupyterDebugger.ts +++ b/src/client/datascience/jupyter/jupyterDebugger.ts @@ -3,15 +3,16 @@ 'use strict'; import { nbformat } from '@jupyterlab/coreutils'; import { inject, injectable } from 'inversify'; +import * as path from 'path'; import * as uuid from 'uuid/v4'; import { DebugConfiguration } from 'vscode'; import * as vsls from 'vsls/vscode'; - import { IApplicationShell, ICommandManager, IDebugService, IWorkspaceService } from '../../common/application/types'; import { traceError, traceInfo, traceWarning } from '../../common/logger'; import { IPlatformService } from '../../common/platform/types'; import { IConfigurationService } from '../../common/types'; import * as localize from '../../common/utils/localize'; +import { EXTENSION_ROOT_DIR } from '../../constants'; import { captureTelemetry, sendTelemetryEvent } from '../../telemetry'; import { concatMultilineStringOutput } from '../common'; import { Identifiers, Telemetry } from '../constants'; @@ -175,7 +176,7 @@ export class JupyterDebugger implements IJupyterDebugger, ICellHashListener { return result; } - private calculatePtvsdPathList(_notebook: INotebook): string | undefined { + private calculatePtvsdPathList(notebook: INotebook): string | undefined { const extraPaths: string[] = []; // Add the settings path first as it takes precedence over the ptvsd extension path @@ -194,14 +195,14 @@ export class JupyterDebugger implements IJupyterDebugger, ICellHashListener { // installed locally by the extension // Actually until this is resolved: https://github.com/microsoft/vscode-python/issues/7615, skip adding // this path. - // const connectionInfo = notebook.server.getConnectionInfo(); - // if (connectionInfo && connectionInfo.localLaunch) { - // let localPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python'); - // if (this.platform.isWindows) { - // localPath = localPath.replace('\\', '\\\\'); - // } - // extraPaths.push(localPath); - // } + const connectionInfo = notebook.server.getConnectionInfo(); + if (connectionInfo && connectionInfo.localLaunch) { + let localPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'lib', 'python'); + if (this.platform.isWindows) { + localPath = localPath.replace('\\', '\\\\'); + } + extraPaths.push(localPath); + } if (extraPaths && extraPaths.length > 0) { return extraPaths.reduce((totalPath, currentPath) => {