66import { IEnvironmentService } from 'vs/platform/environment/common/environment' ;
77import * as paths from 'vs/base/node/paths' ;
88import product from 'vs/platform/product' ;
9- import pkg from 'vs/platform/package' ;
109import * as os from 'os' ;
1110import * as path from 'path' ;
1211import { ParsedArgs } from 'vs/code/node/argv' ;
@@ -41,22 +40,22 @@ export class EnvironmentService implements IEnvironmentService {
4140 get extensionDevelopmentPath ( ) : string { return this . _extensionDevelopmentPath ; }
4241
4342 get isBuilt ( ) : boolean { return ! process . env [ 'VSCODE_DEV' ] ; }
44- get verbose ( ) : boolean { return this . parsedArgs . verbose ; }
43+ get verbose ( ) : boolean { return this . args . verbose ; }
4544
46- get debugBrkFileWatcherPort ( ) : number { return typeof this . parsedArgs . debugBrkFileWatcherPort === 'string' ? Number ( this . parsedArgs . debugBrkFileWatcherPort ) : void 0 ; }
45+ get debugBrkFileWatcherPort ( ) : number { return typeof this . args . debugBrkFileWatcherPort === 'string' ? Number ( this . args . debugBrkFileWatcherPort ) : void 0 ; }
4746
48- constructor ( private parsedArgs : ParsedArgs ) {
47+ constructor ( private args : ParsedArgs ) {
4948 this . _appRoot = path . dirname ( URI . parse ( require . toUrl ( '' ) ) . fsPath ) ;
50- this . _userDataPath = paths . getUserDataPath ( process . platform , pkg . name , parsedArgs [ 'user-data-dir' ] ) ;
49+ this . _userDataPath = args [ 'user-data-dir' ] || paths . getDefaultUserDataPath ( process . platform ) ;
5150
5251 this . _appSettingsHome = path . join ( this . userDataPath , 'User' ) ;
5352 this . _appSettingsPath = path . join ( this . appSettingsHome , 'settings.json' ) ;
5453 this . _appKeybindingsPath = path . join ( this . appSettingsHome , 'keybindings.json' ) ;
5554
5655 this . _userHome = path . join ( os . homedir ( ) , product . dataFolderName ) ;
57- this . _extensionsPath = parsedArgs . extensionHomePath || path . join ( this . _userHome , 'extensions' ) ;
56+ this . _extensionsPath = args . extensionHomePath || path . join ( this . _userHome , 'extensions' ) ;
5857 this . _extensionsPath = path . normalize ( this . _extensionsPath ) ;
5958
60- this . _extensionDevelopmentPath = parsedArgs . extensionDevelopmentPath ;
59+ this . _extensionDevelopmentPath = args . extensionDevelopmentPath ;
6160 }
6261}
0 commit comments