File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments