environment.ts 4.4 KB
Newer Older
J
Joao Moreno 已提交
1 2 3 4 5
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

6
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
7
import { URI } from 'vs/base/common/uri';
J
Joao Moreno 已提交
8

J
Joao Moreno 已提交
9 10
export interface ParsedArgs {
	_: string[];
11 12
	'folder-uri'?: string[]; // undefined or array of 1 or more
	'file-uri'?: string[]; // undefined or array of 1 or more
D
Daniel Imms 已提交
13
	_urls?: string[];
J
Joao Moreno 已提交
14 15
	help?: boolean;
	version?: boolean;
L
Logan Ramos 已提交
16
	telemetry?: boolean;
17
	status?: boolean;
J
Joao Moreno 已提交
18
	wait?: boolean;
19
	waitMarkerFilePath?: string;
J
Joao Moreno 已提交
20
	diff?: boolean;
21
	add?: boolean;
J
Joao Moreno 已提交
22 23
	goto?: boolean;
	'new-window'?: boolean;
24
	'unity-launch'?: boolean; // Always open a new window, except if opening the first window or opening a file or folder as part of the launch.
J
Joao Moreno 已提交
25 26 27
	'reuse-window'?: boolean;
	locale?: string;
	'user-data-dir'?: string;
28
	'prof-startup'?: boolean;
29
	'prof-startup-prefix'?: string;
30
	'prof-append-timers'?: string;
J
Joao Moreno 已提交
31
	verbose?: boolean;
B
Benjamin Pasero 已提交
32 33 34
	trace?: boolean;
	'trace-category-filter'?: string;
	'trace-options'?: string;
35
	log?: string;
J
Joao Moreno 已提交
36 37
	logExtensionHostCommunication?: boolean;
	'extensions-dir'?: string;
38
	'builtin-extensions-dir'?: string;
39
	extensionDevelopmentPath?: string[]; // // undefined or array of 1 or more local paths or URIs
40
	extensionTestsPath?: string; // either a local path or a URI
41
	'extension-development-confirm-save'?: boolean;
42 43
	'inspect-extensions'?: string;
	'inspect-brk-extensions'?: string;
44
	debugId?: string;
45 46
	'inspect-search'?: string;
	'inspect-brk-search'?: string;
S
Sandeep Somavarapu 已提交
47
	'disable-extensions'?: boolean;
48
	'disable-extension'?: string[]; // undefined or array of 1 or more
J
Joao Moreno 已提交
49 50
	'list-extensions'?: boolean;
	'show-versions'?: boolean;
51
	'category'?: string;
52 53 54 55
	'install-extension'?: string[]; // undefined or array of 1 or more
	'uninstall-extension'?: string[]; // undefined or array of 1 or more
	'locate-extension'?: string[]; // undefined or array of 1 or more
	'enable-proposed-api'?: string[]; // undefined or array of 1 or more
D
More  
Daniel Imms 已提交
56
	'open-url'?: boolean;
57
	'skip-getting-started'?: boolean;
58
	'skip-release-notes'?: boolean;
59
	'sticky-quickopen'?: boolean;
B
Benjamin Pasero 已提交
60
	'disable-restore-windows'?: boolean;
61
	'disable-telemetry'?: boolean;
62
	'export-default-configuration'?: string;
63
	'install-source'?: string;
64 65
	'disable-updates'?: boolean;
	'disable-crash-reporter'?: boolean;
66
	'skip-add-to-recently-opened'?: boolean;
P
Peng Lyu 已提交
67
	'max-memory'?: string;
B
Benjamin Pasero 已提交
68 69
	'file-write'?: boolean;
	'file-chmod'?: boolean;
J
Joao Moreno 已提交
70
	'driver'?: string;
71
	'driver-verbose'?: boolean;
M
Martin Aeschlimann 已提交
72
	remote?: string;
73
	'disable-user-env-probe'?: boolean;
74
	'force'?: boolean;
J
João Moreno 已提交
75
	'force-user-env'?: boolean;
M
Martin Aeschlimann 已提交
76

77
	// node flags
78
	'js-flags'?: string;
79 80
	'disable-gpu'?: boolean;
	'nolazy'?: boolean;
J
Joao Moreno 已提交
81 82
}

J
Joao Moreno 已提交
83 84
export const IEnvironmentService = createDecorator<IEnvironmentService>('environmentService');

85
export interface IDebugParams {
86
	port: number | null;
87 88 89 90
	break: boolean;
}

export interface IExtensionHostDebugParams extends IDebugParams {
91
	debugId?: string;
92 93
}

94 95
export const BACKUPS = 'Backups';

J
Joao Moreno 已提交
96
export interface IEnvironmentService {
B
Benjamin Pasero 已提交
97

98
	_serviceBrand: undefined;
J
Joao Moreno 已提交
99

J
Joao Moreno 已提交
100 101
	args: ParsedArgs;

102
	execPath: string;
103
	cliPath: string;
104
	appRoot: string;
105

J
Joao Moreno 已提交
106
	userHome: string;
J
Joao Moreno 已提交
107
	userDataPath: string;
108

109
	appNameLong: string;
110
	appQuality?: string;
S
Sandeep Somavarapu 已提交
111
	appSettingsHome: URI;
112 113 114

	// user roaming data
	userRoamingDataHome: URI;
S
Sandeep Somavarapu 已提交
115
	settingsResource: URI;
116
	keybindingsResource: URI;
P
Peng Lyu 已提交
117
	keyboardLayoutResource: URI;
118
	localeResource: URI;
119

120 121 122 123
	// sync resources
	userDataSyncLogResource: URI;
	settingsSyncPreviewResource: URI;

124 125
	machineSettingsHome: URI;
	machineSettingsResource: URI;
126

127
	globalStorageHome: string;
128 129
	workspaceStorageHome: string;

S
Sandeep Somavarapu 已提交
130
	backupHome: URI;
131 132
	backupWorkspacesPath: string;

133
	untitledWorkspacesHome: URI;
134

135
	isExtensionDevelopment: boolean;
S
Sandeep Somavarapu 已提交
136
	disableExtensions: boolean | string[];
137
	builtinExtensionsPath: string;
138
	extensionsPath?: string;
139
	extensionDevelopmentLocationURI?: URI[];
140
	extensionTestsLocationURI?: URI;
141

142
	debugExtensionHost: IExtensionHostDebugParams;
143

144
	isBuilt: boolean;
145
	wait: boolean;
B
Benjamin Pasero 已提交
146
	status: boolean;
147

148
	log?: string;
149 150 151
	logsPath: string;
	verbose: boolean;

152 153
	mainIPCHandle: string;
	sharedIPCHandle: string;
154

155
	nodeCachedDataDir?: string;
156

157
	installSourcePath: string;
J
Joao Moreno 已提交
158
	disableUpdates: boolean;
159
	disableCrashReporter: boolean;
J
Joao Moreno 已提交
160

161
	driverHandle?: string;
162
	driverVerbose: boolean;
163

164
	galleryMachineIdResource?: URI;
165
}