MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / createSettings

Function createSettings

src/test/standardTest.node.ts:130–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128}
129
130async function createSettings(): Promise<string> {
131 // User data dir can be overridden with an environment variable.
132 const userDataDirectory = process.env.VSC_JUPYTER_USER_DATA_DIR || (await createTempDir());
133 process.env.VSC_JUPYTER_VSCODE_SETTINGS_DIR = userDataDirectory;
134 const settingsFile = path.join(userDataDirectory, 'User', 'settings.json');
135 const defaultSettings: Record<string, string | boolean | string[]> = {
136 'python.insidersChannel': 'off',
137 'deepnote.logging.level': 'debug',
138 'python.logging.level': 'debug',
139 'files.autoSave': 'off',
140 'python.experiments.enabled': true,
141 'python.experiments.optOutFrom': [],
142 'security.workspace.trust.enabled': false, // Disable trusted workspaces.
143 // Disable the start page in VS Code tests, else this UI pops up and has potential to break tests.
144 // For instance if the start page UI opens up, then active editor, active notebook and the like are empty.
145 'python.showStartPage': false,
146 // Disable the restart ask so that restart just happens
147 'deepnote.askForKernelRestart': false,
148 // To get widgets working.
149 'deepnote.widgetScriptSources': ['jsdelivr.com', 'unpkg.com'],
150 'notebook.stickyScroll.enabled': true, // Required for perf tests
151 'notebook.outline.showCodeCells': true // Required for perf tests
152 };
153
154 if (IS_SMOKE_TEST()) {
155 defaultSettings['python.languageServer'] = 'None';
156 }
157 fs.ensureDirSync(path.dirname(settingsFile));
158 fs.writeFileSync(settingsFile, JSON.stringify(defaultSettings, undefined, 4));
159 return userDataDirectory;
160}
161
162async function getExtensionsDir(): Promise<string> {
163 const name = 'vscode_jupyter_exts';

Callers 1

startFunction · 0.85

Calls 4

createTempDirFunction · 0.85
IS_SMOKE_TESTFunction · 0.85
joinMethod · 0.80
dirnameMethod · 0.65

Tested by

no test coverage detected