Skip to content

Commit d5f153e

Browse files
authored
Startup the jupyter server when appropriate (#9708)
* Preload server when appropriate * Fix problem with startup of the server preventing the notebook editor from opening * Fix build errors * Fix DS dependency error occuring in master * Review feedback * Fix news file to have right setting * Fix unit and functional tests. * Address more code review comments * Add unit test for server cache * Add some more tracing * Submit change for the different output file * Fix smoke tests * Fix linter
1 parent f862978 commit d5f153e

33 files changed

+796
-368
lines changed

news/1 Enhancements/7232.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Automatically start the Jupyter server when opening a notebook or the interative window, or when either of those has happened in the last 7 days. This behavior can be disabled with the 'python.dataScience.disableJupyterAutoStart' setting.

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,6 +1804,12 @@
18041804
"description": "When debugging a cell, open this port on the remote box. If -1 is specified, a random port between 8889 and 9000 will be attempted.",
18051805
"scope": "resource"
18061806
},
1807+
"python.dataScience.disableJupyterAutoStart": {
1808+
"type": "boolean",
1809+
"default": false,
1810+
"description": "When true, disables Jupyter from being automatically started for you. You must instead run a cell to start Jupyter.",
1811+
"scope": "resource"
1812+
},
18071813
"python.dataScience.textOutputLimit": {
18081814
"type": "number",
18091815
"default": 20000,

src/client/common/asyncDisposableRegistry.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ import { IAsyncDisposable, IAsyncDisposableRegistry, IDisposable } from './types
77
// List of disposables that need to run a promise.
88
@injectable()
99
export class AsyncDisposableRegistry implements IAsyncDisposableRegistry {
10-
private list: (IDisposable | IAsyncDisposable)[] = [];
10+
private _list: (IDisposable | IAsyncDisposable)[] = [];
1111

1212
public async dispose(): Promise<void> {
13-
const promises = this.list.map(l => l.dispose());
13+
const promises = this._list.map(l => l.dispose());
1414
await Promise.all(promises);
1515
}
1616

1717
public push(disposable?: IDisposable | IAsyncDisposable) {
1818
if (disposable) {
19-
this.list.push(disposable);
19+
this._list.push(disposable);
2020
}
2121
}
22+
23+
public get list(): (IDisposable | IAsyncDisposable)[] {
24+
return this._list;
25+
}
2226
}

src/client/common/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ export interface IDataScienceSettings {
396396
themeMatplotlibPlots?: boolean;
397397
useWebViewServer?: boolean;
398398
variableQueries: IVariableQuery[];
399+
disableJupyterAutoStart?: boolean;
399400
}
400401

401402
export const IConfigurationService = Symbol('IConfigurationService');

0 commit comments

Comments
 (0)