@@ -10,7 +10,6 @@ import { AddressInfo } from 'net';
1010import * as os from 'os' ;
1111import * as readline from 'readline' ;
1212import { performance } from 'perf_hooks' ;
13- import { fileURLToPath } from 'url' ;
1413import minimist from 'minimist' ;
1514import { devInjectNodeModuleLookupPath , removeGlobalNodeJsModuleLookupPaths } from './bootstrap-node.js' ;
1615import { bootstrapESM } from './bootstrap-esm.js' ;
@@ -20,8 +19,6 @@ import * as perf from './vs/base/common/performance.js';
2019import { INLSConfiguration } from './vs/nls.js' ;
2120import { IServerAPI } from './vs/server/node/remoteExtensionHostAgentServer.js' ;
2221
23- const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
24-
2522perf . mark ( 'code/server/start' ) ;
2623( globalThis as any ) . vscodeServerStartTime = performance . now ( ) ;
2724
@@ -45,7 +42,7 @@ const extensionInstallArgs = ['install-extension', 'install-builtin-extension',
4542
4643const shouldSpawnCli = parsedArgs . help || parsedArgs . version || extensionLookupArgs . some ( a => ! ! parsedArgs [ a ] ) || ( extensionInstallArgs . some ( a => ! ! parsedArgs [ a ] ) && ! parsedArgs [ 'start-server' ] ) ;
4744
48- const nlsConfiguration = await resolveNLSConfiguration ( { userLocale : 'en' , osLocale : 'en' , commit : product . commit , userDataPath : '' , nlsMetadataPath : __dirname } ) ;
45+ const nlsConfiguration = await resolveNLSConfiguration ( { userLocale : 'en' , osLocale : 'en' , commit : product . commit , userDataPath : '' , nlsMetadataPath : import . meta . dirname } ) ;
4946
5047if ( shouldSpawnCli ) {
5148 loadCode ( nlsConfiguration ) . then ( ( mod ) => {
@@ -241,7 +238,7 @@ async function loadCode(nlsConfiguration: INLSConfiguration) {
241238 if ( process . env [ 'VSCODE_DEV' ] ) {
242239 // When running out of sources, we need to load node modules from remote/node_modules,
243240 // which are compiled against nodejs, not electron
244- process . env [ 'VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH' ] = process . env [ 'VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH' ] || path . join ( __dirname , '..' , 'remote' , 'node_modules' ) ;
241+ process . env [ 'VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH' ] = process . env [ 'VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH' ] || path . join ( import . meta . dirname , '..' , 'remote' , 'node_modules' ) ;
245242 devInjectNodeModuleLookupPath ( process . env [ 'VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH' ] ) ;
246243 } else {
247244 delete process . env [ 'VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH' ] ;
0 commit comments