Skip to content

Commit 37c1e35

Browse files
committed
recommend jupyter extension
1 parent 153fa94 commit 37c1e35

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,11 @@
852852
"type": "object",
853853
"title": "Python Configuration",
854854
"properties": {
855+
"python.promptToInstallJupyter": {
856+
"type": "boolean",
857+
"default": true,
858+
"description": "Display prompt to install Jupyter Extension."
859+
},
855860
"python.pythonPath": {
856861
"type": "string",
857862
"default": "python",

src/client/jupyter/main.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,27 @@ export class Jupyter extends vscode.Disposable {
2828
private codeLensProvider: JupyterCodeLensProvider;
2929
private lastUsedPythonPath: string;
3030
private codeHelper: CodeHelper;
31+
32+
private async displaySuggestion(): Promise<void> {
33+
return new Promise<void>(resolve => {
34+
let recommend = vscode.workspace.getConfiguration('python').get('promptToInstallJupyter', true);
35+
if (!recommend) {
36+
return resolve();
37+
}
38+
vscode.window.showInformationMessage('Deprecated: Please install the new Jupyter extension. Jupyter functionality within this extension has been deprecated.', 'Do not show again')
39+
.then(item => {
40+
if (item !== 'Do not show again') {
41+
return resolve();
42+
}
43+
vscode.workspace.getConfiguration('python').update('promptToInstallJupyter', false)
44+
.then(() => {
45+
resolve();
46+
}, ex => {
47+
resolve();
48+
});
49+
});
50+
});
51+
}
3152
constructor(private outputChannel: vscode.OutputChannel) {
3253
super(() => { });
3354
this.disposables = [];
@@ -116,7 +137,8 @@ export class Jupyter extends vscode.Disposable {
116137
this.outputChannel.appendLine(formatErrorForLogging(reason));
117138
});
118139
}
119-
return this.kernelManager.startKernelFor(language)
140+
return this.displaySuggestion()
141+
.then(() => this.kernelManager.startKernelFor(language))
120142
.then(kernel => {
121143
if (kernel) {
122144
this.onKernelChanged(kernel);

0 commit comments

Comments
 (0)