forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelpers.ts
More file actions
61 lines (56 loc) · 2.49 KB
/
Copy pathhelpers.ts
File metadata and controls
61 lines (56 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import { noop } from 'lodash';
import { IDataScienceSettings } from '../../client/common/types';
// The default base set of data science settings to use
export function defaultDataScienceSettings(): IDataScienceSettings {
return {
allowImportFromNotebook: true,
jupyterLaunchTimeout: 10,
jupyterLaunchRetries: 3,
enabled: true,
jupyterServerURI: 'local',
// tslint:disable-next-line: no-invalid-template-strings
notebookFileRoot: '${fileDirname}',
changeDirOnImportExport: false,
useDefaultConfigForJupyter: true,
jupyterInterruptTimeout: 10000,
searchForJupyter: true,
showCellInputCode: true,
collapseCellInputCodeByDefault: true,
allowInput: true,
maxOutputSize: 400,
enableScrollingForCellOutputs: true,
errorBackgroundColor: '#FFFFFF',
sendSelectionToInteractiveWindow: false,
variableExplorerExclude: 'module;function;builtin_function_or_method',
codeRegularExpression: '^(#\\s*%%|#\\s*\\<codecell\\>|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])',
markdownRegularExpression: '^(#\\s*%%\\s*\\[markdown\\]|#\\s*\\<markdowncell\\>)',
enablePlotViewer: true,
runStartupCommands: '',
debugJustMyCode: true,
variableQueries: [],
jupyterCommandLineArguments: [],
widgetScriptSources: []
};
}
export function takeSnapshot() {
// If you're investigating memory leaks in the tests, using the node-memwatch
// code below can be helpful. It will at least write out what objects are taking up the most
// memory.
// Alternatively, using the test:functional:memleak task and sticking breakpoints here and in
// writeDiffSnapshot can be used as convenient locations to create heap snapshots and diff them.
// tslint:disable-next-line: no-require-imports
//const memwatch = require('@raghb1/node-memwatch');
return {}; //new memwatch.HeapDiff();
}
//let snapshotCounter = 1;
// tslint:disable-next-line: no-any
export function writeDiffSnapshot(_snapshot: any, _prefix: string) {
noop(); // Stick breakpoint here when generating heap snapshots
// const diff = snapshot.end();
// const file = path.join(EXTENSION_ROOT_DIR, 'tmp', `SD-${snapshotCounter}-${prefix}.json`);
// snapshotCounter += 1;
// fs.writeFile(file, JSON.stringify(diff), { encoding: 'utf-8' }).ignoreErrors();
}