Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/server-cli.ts
3285 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import './bootstrap-server.js'; // this MUST come before other imports as it changes global state
7
import { join } from 'node:path';
8
import { devInjectNodeModuleLookupPath } from './bootstrap-node.js';
9
import { bootstrapESM } from './bootstrap-esm.js';
10
import { resolveNLSConfiguration } from './vs/base/node/nls.js';
11
import { product } from './bootstrap-meta.js';
12
13
// NLS
14
const nlsConfiguration = await resolveNLSConfiguration({ userLocale: 'en', osLocale: 'en', commit: product.commit, userDataPath: '', nlsMetadataPath: import.meta.dirname });
15
process.env['VSCODE_NLS_CONFIG'] = JSON.stringify(nlsConfiguration); // required for `bootstrap-esm` to pick up NLS messages
16
17
if (process.env['VSCODE_DEV']) {
18
// When running out of sources, we need to load node modules from remote/node_modules,
19
// which are compiled against nodejs, not electron
20
process.env['VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH'] = process.env['VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH'] || join(import.meta.dirname, '..', 'remote', 'node_modules');
21
devInjectNodeModuleLookupPath(process.env['VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH']);
22
} else {
23
delete process.env['VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH'];
24
}
25
26
// Bootstrap ESM
27
await bootstrapESM();
28
29
// Load Server
30
await import('./vs/server/node/server.cli.js');
31
32