-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialize env variable to resolve a number of debugger issues (#11058)
* Initialize env var for debugpy to work properly * Add news entry * oops
- Loading branch information
1 parent
4b50f31
commit aab4afe
Showing
7 changed files
with
61 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Initialize the environment variable `PYDEVD_IPYTHON_COMPATIBLE_DEBUGGING` for the `Python` debugger when debugging `Interactive Window` and `Notebooks`. | ||
This also addresses the following issues [10600](https://github.com/microsoft/vscode-jupyter/issues/10600), [8146](https://github.com/microsoft/vscode-jupyter/issues/8146), [10106](https://github.com/microsoft/vscode-jupyter/issues/10106) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
import { injectable } from 'inversify'; | ||
import { isPythonKernelConnection } from './helpers'; | ||
import { IKernel, IStartupCodeProvider, StartupCodePriority } from './types'; | ||
|
||
@injectable() | ||
export class DebugStartupCodeProvider implements IStartupCodeProvider { | ||
public priority = StartupCodePriority.Base; | ||
|
||
async getCode(kernel: IKernel): Promise<string[]> { | ||
if (!isPythonKernelConnection(kernel.kernelConnectionMetadata)) { | ||
return []; | ||
} | ||
|
||
return [ | ||
'import os as __VSCODE_os', | ||
// Required to get pydevd to work properly in Python kernel, more info here https://github.com/microsoft/vscode-jupyter/issues/11033 | ||
'__VSCODE_os.environ["PYDEVD_IPYTHON_COMPATIBLE_DEBUGGING"] = "1"', | ||
'del __VSCODE_os' | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters