vscode.patch 50.4 KB
Newer Older
A
Asher 已提交
1
diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
A
Asher 已提交
2
index 99bd930a91..319c4bd3c3 100644
A
Asher 已提交
3 4
--- a/build/gulpfile.vscode.js
+++ b/build/gulpfile.vscode.js
A
Asher 已提交
5
@@ -47,24 +47,31 @@ const nodeModules = ['electron', 'original-fs']
A
Asher 已提交
6 7 8 9
 
 // Build
 const vscodeEntryPoints = _.flatten([
-	buildfile.entrypoint('vs/workbench/workbench.main'),
A
Asher 已提交
10
+	// buildfile.entrypoint('vs/workbench/workbench.main'),
A
Asher 已提交
11 12 13 14 15 16
+	buildfile.entrypoint('vs/workbench/workbench.web.api'),
+	buildfile.entrypoint('vs/server/src/cli'),
+	buildfile.entrypoint('vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux'),
+	buildfile.entrypoint('vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.win'),
+	buildfile.entrypoint('vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin'),
 	buildfile.base,
A
Asher 已提交
17
 	buildfile.serviceWorker,
A
Asher 已提交
18 19 20 21 22 23 24 25 26 27
-	buildfile.workbench,
-	buildfile.code
+	buildfile.workbenchWeb,
+	// buildfile.code
 ]);
 
 const vscodeResources = [
-	'out-build/main.js',
-	'out-build/cli.js',
-	'out-build/driver.js',
A
Asher 已提交
28
+	// 'out-build/main.js',
A
Asher 已提交
29 30
+	// 'out-build/cli.js',
+	// 'out-build/driver.js',
A
Asher 已提交
31 32
+	'out-build/vs/server/main.js',
+	'out-build/vs/server/src/uriTransformer.js',
A
Asher 已提交
33 34 35 36 37
 	'out-build/bootstrap.js',
 	'out-build/bootstrap-fork.js',
 	'out-build/bootstrap-amd.js',
 	'out-build/bootstrap-window.js',
 	'out-build/paths.js',
A
Asher 已提交
38
-	'out-build/vs/**/*.{svg,png,html}',
A
Asher 已提交
39
-	'!out-build/vs/code/browser/**/*.html',
A
Asher 已提交
40
+	'out-build/vs/**/*.{svg,png,html,ico}',
A
Asher 已提交
41 42 43 44
+	// '!out-build/vs/code/browser/**/*.html',
 	'out-build/vs/base/common/performance.js',
 	'out-build/vs/base/node/languagePacks.js',
 	'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh,ps.sh}',
A
Asher 已提交
45
@@ -79,10 +86,12 @@ const vscodeResources = [
A
Asher 已提交
46
 	'out-build/vs/workbench/contrib/welcome/walkThrough/**/*.md',
A
Asher 已提交
47 48
 	'out-build/vs/platform/files/**/*.exe',
 	'out-build/vs/platform/files/**/*.md',
A
Asher 已提交
49 50 51 52 53
-	'out-build/vs/code/electron-browser/workbench/**',
-	'out-build/vs/code/electron-browser/sharedProcess/sharedProcess.js',
-	'out-build/vs/code/electron-browser/issue/issueReporter.js',
-	'out-build/vs/code/electron-browser/processExplorer/processExplorer.js',
+	'out-build/vs/code/browser/workbench/**',
A
Asher 已提交
54
+	// 'out-build/vs/code/electron-browser/workbench/**',
A
Asher 已提交
55 56 57 58 59 60 61
+	// 'out-build/vs/code/electron-browser/sharedProcess/sharedProcess.js',
+	// 'out-build/vs/code/electron-browser/issue/issueReporter.js',
+	// 'out-build/vs/code/electron-browser/processExplorer/processExplorer.js',
+	'!out-build/vs/server/doc/**',
 	'!**/test/**'
 ];
 
A
Asher 已提交
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts
index fa12f62900..1dbaac1640 100644
--- a/src/vs/base/browser/dom.ts
+++ b/src/vs/base/browser/dom.ts
@@ -1187,6 +1187,7 @@ export function animate(fn: () => void): IDisposable {
 
 
 
+const basePath = window.location.pathname.replace(/\/+$/, '');
 const _location = URI.parse(window.location.href);
 
 export function asDomUri(uri: URI): URI {
@@ -1197,10 +1198,10 @@ export function asDomUri(uri: URI): URI {
 		//todo@joh remove this once we have sw in electron going
 		return uri;
 	}
-	if (Schemas.vscodeRemote === uri.scheme) {
+	if (Schemas.codeServer === uri.scheme) {
 		// rewrite vscode-remote-uris to uris of the window location
 		// so that they can be intercepted by the service worker
-		return _location.with({ path: '/vscode-resources/fetch', query: `u=${JSON.stringify(uri)}` });
+		return _location.with({ path: `${basePath}/vscode-resources/${uri.fsPath}` });
 	}
 	return uri;
A
Asher 已提交
86
 }
A
Asher 已提交
87
diff --git a/src/vs/base/browser/ui/menu/menu.ts b/src/vs/base/browser/ui/menu/menu.ts
A
Asher 已提交
88
index c2b60a5dc9..3f40fa0bdf 100644
A
Asher 已提交
89 90 91 92 93 94 95 96 97 98 99
--- a/src/vs/base/browser/ui/menu/menu.ts
+++ b/src/vs/base/browser/ui/menu/menu.ts
@@ -22,7 +22,7 @@ import { isLinux, isMacintosh } from 'vs/base/common/platform';
 
 function createMenuMnemonicRegExp() {
 	try {
-		return new RegExp('\\(&([^\\s&])\\)|(?<!&)&([^\\s&])');
+		return new RegExp('\\(&([^\\s&])\\)|([^&]|^)&([^\\s&])');
 	} catch (err) {
 		return new RegExp('\uFFFF'); // never match please
 	}
A
Asher 已提交
100
@@ -802,7 +802,7 @@ export function cleanMnemonic(label: string): string {
A
Asher 已提交
101 102 103 104
 		return label;
 	}
 
-	const mnemonicInText = matches[0].charAt(0) === '&';
A
Asher 已提交
105
+	const mnemonicInText = matches[3];
A
Asher 已提交
106 107 108
 
-	return label.replace(regex, mnemonicInText ? '$2' : '').trim();
+	return label.replace(regex, mnemonicInText ? '$2$3' : '').trim();
A
Asher 已提交
109
 }
A
Asher 已提交
110
diff --git a/src/vs/base/common/network.ts b/src/vs/base/common/network.ts
A
Asher 已提交
111
index 46d2933a05..7e8ca77342 100644
A
Asher 已提交
112 113
--- a/src/vs/base/common/network.ts
+++ b/src/vs/base/common/network.ts
A
Asher 已提交
114
@@ -46,6 +46,7 @@ export namespace Schemas {
A
Asher 已提交
115 116 117 118
 	export const command: string = 'command';
 
 	export const vscodeRemote: string = 'vscode-remote';
+	export const codeServer: string = 'code-server';
A
Asher 已提交
119 120
 
 	export const userData: string = 'vscode-userdata';
A
Asher 已提交
121
 }
A
Asher 已提交
122
diff --git a/src/vs/base/common/platform.ts b/src/vs/base/common/platform.ts
A
Asher 已提交
123
index d7371552d3..d2ab92983e 100644
A
Asher 已提交
124 125
--- a/src/vs/base/common/platform.ts
+++ b/src/vs/base/common/platform.ts
A
Asher 已提交
126 127 128
@@ -54,8 +54,18 @@ if (typeof navigator === 'object' && !isElectronRenderer) {
 	_isMacintosh = _userAgent.indexOf('Macintosh') >= 0;
 	_isLinux = _userAgent.indexOf('Linux') >= 0;
A
Asher 已提交
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
 	_isWeb = true;
-	_locale = navigator.language;
-	_language = _locale;
+	_locale = LANGUAGE_DEFAULT;
+	_language = LANGUAGE_DEFAULT;
+	const rawNlsConfig = typeof document !== 'undefined'
+		&& document.getElementById('vscode-remote-nls-configuration')!.getAttribute('data-settings')!;
+	if (rawNlsConfig) {
+		try {
+			const nlsConfig: NLSConfig = JSON.parse(rawNlsConfig);
+			_locale = nlsConfig.locale;
+			_translationsConfigFile = nlsConfig._translationsConfigFile;
+			_language = nlsConfig.availableLanguages['*'] || LANGUAGE_DEFAULT;
+		} catch (error) { /* Oh well. */ }
+	}
 } else if (typeof process === 'object') {
 	_isWindows = (process.platform === 'win32');
 	_isMacintosh = (process.platform === 'darwin');
A
Asher 已提交
147
diff --git a/src/vs/code/browser/workbench/workbench.html b/src/vs/code/browser/workbench/workbench.html
A
Asher 已提交
148
index 5b06636edb..60b508079a 100644
A
Asher 已提交
149 150
--- a/src/vs/code/browser/workbench/workbench.html
+++ b/src/vs/code/browser/workbench/workbench.html
A
Asher 已提交
151
@@ -4,7 +4,7 @@
A
Asher 已提交
152 153 154
 	<head>
 		<meta charset="utf-8" />
 
A
Asher 已提交
155 156
-		<link rel="icon" href="/favicon.ico" type="image/x-icon" />
+		<link rel="icon" href="./favicon.ico" type="image/x-icon" />
A
Asher 已提交
157
 
A
Asher 已提交
158 159 160
 		<!-- Disable pinch zooming -->
 		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
@@ -19,13 +19,14 @@
A
Asher 已提交
161
 
A
Asher 已提交
162 163
 		<!-- Workaround to pass product configuration-->
 		<meta id="vscode-remote-product-configuration" data-settings="{{PRODUCT_CONFIGURATION}}">
A
Asher 已提交
164 165 166
+		<meta id="vscode-remote-nls-configuration" data-settings="{{NLS_CONFIGURATION}}">
 	</head>
 
A
Asher 已提交
167 168 169 170 171 172 173 174 175
 	<body aria-label="">
 	</body>
 
 	<!-- Application insights telemetry library -->
-	<script src="https://az416426.vo.msecnd.net/scripts/a/ai.0.js"></script>
+	<!-- <script src="https://az416426.vo.msecnd.net/scripts/a/ai.0.js"></script> -->
 
 	<!-- Require our AMD loader -->
 	<script src="./out/vs/loader.js"></script>
A
Asher 已提交
176
diff --git a/src/vs/code/browser/workbench/workbench.js b/src/vs/code/browser/workbench/workbench.js
A
Asher 已提交
177
index 65fae7c82d..c9744007c9 100644
A
Asher 已提交
178 179
--- a/src/vs/code/browser/workbench/workbench.js
+++ b/src/vs/code/browser/workbench/workbench.js
A
Asher 已提交
180
@@ -7,15 +7,20 @@
A
Asher 已提交
181 182 183 184 185 186 187 188 189
 
 (function () {
 
+	const basePath = window.location.pathname.replace(/\/+$/, '');
+	const base = window.location.origin + basePath;
 	require.config({
-		baseUrl: `${window.location.origin}/out`,
+		baseUrl: `${base}/out`,
+		baseScheme: window.location.protocol.replace(/:$/, ''),
A
Asher 已提交
190
+		basePath: basePath,
A
Asher 已提交
191 192 193 194 195 196 197
+		baseAuthority: window.location.host,
 		paths: {
-			'vscode-textmate': `${window.location.origin}/node_modules/vscode-textmate/release/main`,
-			'onigasm-umd': `${window.location.origin}/node_modules/onigasm-umd/release/main`,
-			'xterm': `${window.location.origin}/node_modules/xterm/lib/xterm.js`,
-			'xterm-addon-search': `${window.location.origin}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
-			'xterm-addon-web-links': `${window.location.origin}/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`,
A
Asher 已提交
198
-			'semver-umd': `${window.location.origin}/node_modules/semver-umd/lib/semver-umd.js`,
A
Asher 已提交
199 200 201 202 203
+			'vscode-textmate': `${base}/node_modules/vscode-textmate/release/main`,
+			'onigasm-umd': `${base}/node_modules/onigasm-umd/release/main`,
+			'xterm': `${base}/node_modules/xterm/lib/xterm.js`,
+			'xterm-addon-search': `${base}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
+			'xterm-addon-web-links': `${base}/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`,
A
Asher 已提交
204
+			'semver-umd': `${base}/node_modules/semver-umd/lib/semver-umd.js`,
A
Asher 已提交
205 206 207
 		}
 	});
 
A
Asher 已提交
208
diff --git a/src/vs/platform/environment/common/environment.ts b/src/vs/platform/environment/common/environment.ts
A
Asher 已提交
209
index a6c9eb9d11..3f8995b727 100644
A
Asher 已提交
210 211
--- a/src/vs/platform/environment/common/environment.ts
+++ b/src/vs/platform/environment/common/environment.ts
A
Asher 已提交
212
@@ -81,6 +81,8 @@ export interface ParsedArgs {
A
Asher 已提交
213
 
A
Asher 已提交
214 215 216 217 218 219 220 221 222 223 224
 	// Web flags
 	'web-user-data-dir'?: string;
+	'extra-extensions-dir'?: string | string[];
+	'extra-builtin-extensions-dir'?: string | string[];
 }
 
 export const IEnvironmentService = createDecorator<IEnvironmentService>('environmentService');
@@ -173,4 +175,6 @@ export interface IEnvironmentService {
 	readonly webviewCspSource: string;
 
 	readonly galleryMachineIdResource?: URI;
A
Asher 已提交
225 226 227 228
+	extraExtensionPaths: string[];
+	extraBuiltinExtensionPaths: string[];
 }
diff --git a/src/vs/platform/environment/node/environmentService.ts b/src/vs/platform/environment/node/environmentService.ts
A
Asher 已提交
229
index 9373b22383..33ebcfc081 100644
A
Asher 已提交
230 231
--- a/src/vs/platform/environment/node/environmentService.ts
+++ b/src/vs/platform/environment/node/environmentService.ts
A
Asher 已提交
232
@@ -277,6 +277,15 @@ export class EnvironmentService implements IEnvironmentService {
A
Asher 已提交
233
 
A
Asher 已提交
234 235 236 237
 	readonly webviewResourceRoot = 'vscode-resource:{{resource}}';
 	readonly webviewCspSource = 'vscode-resource:';
+	@memoize get extraExtensionPaths(): string[] {
+		return this.arrayify(this._args['extra-extensions-dir']).map((p) => <string>parsePathArg(p, process));
A
Asher 已提交
238
+	}
A
Asher 已提交
239 240
+	@memoize get extraBuiltinExtensionPaths(): string[] {
+		return this.arrayify(this._args['extra-builtin-extensions-dir']).map((p) => <string>parsePathArg(p, process));
A
Asher 已提交
241
+	}
A
Asher 已提交
242 243 244 245
+	private arrayify<T>(arg: T | T[] = []): T[] {
+		return (Array.isArray(arg) ? arg : [arg]);
+	}
 
A
Asher 已提交
246 247 248
 	constructor(private _args: ParsedArgs, private _execPath: string) {
 		if (!process.env['VSCODE_LOGS']) {
diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts
A
Asher 已提交
249
index 70cd46c824..33d661644b 100644
A
Asher 已提交
250 251
--- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts
+++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts
A
Asher 已提交
252
@@ -725,11 +725,15 @@ export class ExtensionManagementService extends Disposable implements IExtension
A
Asher 已提交
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
 
 	private scanSystemExtensions(): Promise<ILocalExtension[]> {
 		this.logService.trace('Started scanning system extensions');
-		const systemExtensionsPromise = this.scanExtensions(this.systemExtensionsPath, ExtensionType.System)
-			.then(result => {
-				this.logService.trace('Scanned system extensions:', result.length);
-				return result;
-			});
+		const systemExtensionsPromise = Promise.all([
+			this.scanExtensions(this.systemExtensionsPath, ExtensionType.System),
+			...this.environmentService.extraBuiltinExtensionPaths
+				.map((path) => this.scanExtensions(path, ExtensionType.System))
+		]).then((results) => {
+			const result = results.reduce((flat, current) => flat.concat(current), []);
+			this.logService.info('Scanned system extensions:', result.length);
+			return result;
+		});
 		if (this.environmentService.isBuilt) {
 			return systemExtensionsPromise;
 		}
A
Asher 已提交
273
@@ -751,9 +755,16 @@ export class ExtensionManagementService extends Disposable implements IExtension
A
Asher 已提交
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
 			.then(([systemExtensions, devSystemExtensions]) => [...systemExtensions, ...devSystemExtensions]);
 	}
 
+	private scanAllUserExtensions(folderName: string, type: ExtensionType): Promise<ILocalExtension[]> {
+		return Promise.all([
+			this.scanExtensions(folderName, type),
+			...this.environmentService.extraExtensionPaths.map((p) => this.scanExtensions(p, ExtensionType.User))
+		]).then((results) => results.reduce((flat, current) => flat.concat(current), []));
+	}
+
 	private scanUserExtensions(excludeOutdated: boolean): Promise<ILocalExtension[]> {
 		this.logService.trace('Started scanning user extensions');
-		return Promise.all([this.getUninstalledExtensions(), this.scanExtensions(this.extensionsPath, ExtensionType.User)])
+		return Promise.all([this.getUninstalledExtensions(), this.scanAllUserExtensions(this.extensionsPath, ExtensionType.User)])
 			.then(([uninstalled, extensions]) => {
 				extensions = extensions.filter(e => !uninstalled[new ExtensionIdentifierWithVersion(e.identifier, e.manifest.version).key()]);
 				if (excludeOutdated) {
A
Asher 已提交
291
@@ -806,7 +817,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
A
Asher 已提交
292 293 294 295 296 297 298 299
 
 	private async removeUninstalledExtensions(): Promise<void> {
 		const uninstalled = await this.getUninstalledExtensions();
-		const extensions = await this.scanExtensions(this.extensionsPath, ExtensionType.User); // All user extensions
+		const extensions = await this.scanAllUserExtensions(this.extensionsPath, ExtensionType.User); // All user extensions
 		const installed: Set<string> = new Set<string>();
 		for (const e of extensions) {
 			if (!uninstalled[new ExtensionIdentifierWithVersion(e.identifier, e.manifest.version).key()]) {
A
Asher 已提交
300
@@ -825,7 +836,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
A
Asher 已提交
301 302 303 304 305 306 307 308
 	}
 
 	private removeOutdatedExtensions(): Promise<void> {
-		return this.scanExtensions(this.extensionsPath, ExtensionType.User) // All user extensions
+		return this.scanAllUserExtensions(this.extensionsPath, ExtensionType.User) // All user extensions
 			.then(extensions => {
 				const toRemove: ILocalExtension[] = [];
 
A
Asher 已提交
309
diff --git a/src/vs/platform/localizations/electron-browser/localizationsService.ts b/src/vs/platform/localizations/electron-browser/localizationsService.ts
A
Asher 已提交
310
index 353161166e..cff8e2750e 100644
A
Asher 已提交
311 312
--- a/src/vs/platform/localizations/electron-browser/localizationsService.ts
+++ b/src/vs/platform/localizations/electron-browser/localizationsService.ts
A
Asher 已提交
313
@@ -6,7 +6,7 @@
A
Asher 已提交
314 315 316 317 318
 import { IChannel } from 'vs/base/parts/ipc/common/ipc';
 import { Event } from 'vs/base/common/event';
 import { ILocalizationsService, LanguageType } from 'vs/platform/localizations/common/localizations';
-import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService';
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
A
Asher 已提交
319
 import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
A
Asher 已提交
320 321
 
 export class LocalizationsService implements ILocalizationsService {
A
Asher 已提交
322
@@ -15,8 +15,8 @@ export class LocalizationsService implements ILocalizationsService {
A
Asher 已提交
323 324 325 326 327
 
 	private channel: IChannel;
 
-	constructor(@ISharedProcessService sharedProcessService: ISharedProcessService) {
-		this.channel = sharedProcessService.getChannel('localizations');
A
Asher 已提交
328
+	constructor(@IRemoteAgentService remoteAgentService: IRemoteAgentService) {
A
Asher 已提交
329 330 331 332
+		this.channel = remoteAgentService.getConnection()!.getChannel('localizations');
 	}
 
 	get onDidLanguagesChange(): Event<void> { return this.channel.listen('onDidLanguagesChange'); }
A
Asher 已提交
333
diff --git a/src/vs/platform/log/common/logIpc.ts b/src/vs/platform/log/common/logIpc.ts
A
Asher 已提交
334
index 9f68b645b6..54f9e26c88 100644
A
Asher 已提交
335 336 337 338 339 340 341 342 343 344
--- a/src/vs/platform/log/common/logIpc.ts
+++ b/src/vs/platform/log/common/logIpc.ts
@@ -26,6 +26,7 @@ export class LogLevelSetterChannel implements IServerChannel {
 	call(_: unknown, command: string, arg?: any): Promise<any> {
 		switch (command) {
 			case 'setLevel': this.service.setLevel(arg); return Promise.resolve();
+			case 'getLevel': return Promise.resolve(this.service.getLevel());
 		}
 
 		throw new Error(`Call not found: ${command}`);
A
Asher 已提交
345 346 347
@@ -43,6 +44,9 @@ export class LogLevelSetterChannelClient {
 	setLevel(level: LogLevel): void {
 		this.channel.call('setLevel', level);
A
Asher 已提交
348 349 350 351
 	}
+	getLevel(): Promise<LogLevel> {
+		return this.channel.call('getLevel');
+	}
A
Asher 已提交
352 353 354
 }
 
 export class FollowerLogService extends DelegatedLogService implements ILogService {
A
Asher 已提交
355
diff --git a/src/vs/platform/product/browser/productService.ts b/src/vs/platform/product/browser/productService.ts
A
Asher 已提交
356
index fbdf03fd3e..d498d4d192 100644
A
Asher 已提交
357 358 359 360 361 362 363 364 365
--- a/src/vs/platform/product/browser/productService.ts
+++ b/src/vs/platform/product/browser/productService.ts
@@ -17,7 +17,7 @@ export class ProductService implements IProductService {
 
 	_serviceBrand: ServiceIdentifier<IProductService>;
 
-	get version(): string { return '1.35.0'; }
+	get version(): string { return this.productConfiguration ? (this.productConfiguration as any).version : 'development'; }
 
A
Asher 已提交
366
 	get commit(): string | undefined { return this.productConfiguration ? this.productConfiguration.commit : undefined; }
A
Asher 已提交
367 368 369 370 371 372 373 374 375 376 377 378 379
 
diff --git a/src/vs/platform/product/node/package.ts b/src/vs/platform/product/node/package.ts
index d39c5877d6..c189d6f19f 100644
--- a/src/vs/platform/product/node/package.ts
+++ b/src/vs/platform/product/node/package.ts
@@ -9,6 +9,7 @@ import { getPathFromAmdModule } from 'vs/base/common/amd';
 export interface IPackageConfiguration {
 	name: string;
 	version: string;
+	codeServerVersion: string;
 }
 
 const rootPath = path.dirname(getPathFromAmdModule(require, ''));
A
Asher 已提交
380 381 382 383 384
diff --git a/src/vs/platform/remote/browser/browserSocketFactory.ts b/src/vs/platform/remote/browser/browserSocketFactory.ts
index 6b24ec0781..4d05c63193 100644
--- a/src/vs/platform/remote/browser/browserSocketFactory.ts
+++ b/src/vs/platform/remote/browser/browserSocketFactory.ts
@@ -133,7 +133,7 @@ export class BrowserSocketFactory implements ISocketFactory {
A
Asher 已提交
385
 	}
A
Asher 已提交
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405
 
 	connect(host: string, port: number, query: string, callback: IConnectCallback): void {
-		const socket = this._webSocketFactory.create(`ws://${host}:${port}/?${query}&skipWebSocketFrames=false`);
+		const socket = this._webSocketFactory.create(`${window.location.protocol === 'https:' ? 'wss' : 'ws'}://${window.location.host}${window.location.pathname}?${query}&skipWebSocketFrames=false`);
 		const errorListener = socket.onError((err) => callback(err, undefined));
 		socket.onOpen(() => {
 			errorListener.dispose();
diff --git a/src/vs/platform/remote/common/remoteHosts.ts b/src/vs/platform/remote/common/remoteHosts.ts
index 5578246cc8..ba38bb0055 100644
--- a/src/vs/platform/remote/common/remoteHosts.ts
+++ b/src/vs/platform/remote/common/remoteHosts.ts
@@ -6,7 +6,7 @@
 import { URI } from 'vs/base/common/uri';
 import { Schemas } from 'vs/base/common/network';
 
-export const REMOTE_HOST_SCHEME = Schemas.vscodeRemote;
+export const REMOTE_HOST_SCHEME = Schemas.codeServer;
 
 export function getRemoteAuthority(uri: URI): string | undefined {
 	return uri.scheme === REMOTE_HOST_SCHEME ? uri.authority : undefined;
A
Asher 已提交
406
diff --git a/src/vs/platform/update/electron-browser/updateService.ts b/src/vs/platform/update/electron-browser/updateService.ts
A
Asher 已提交
407
index 952c39cdbe..fee00b3b39 100644
A
Asher 已提交
408 409
--- a/src/vs/platform/update/electron-browser/updateService.ts
+++ b/src/vs/platform/update/electron-browser/updateService.ts
A
Asher 已提交
410
@@ -6,7 +6,7 @@
A
Asher 已提交
411 412 413 414 415
 import { IChannel } from 'vs/base/parts/ipc/common/ipc';
 import { Event, Emitter } from 'vs/base/common/event';
 import { IUpdateService, State } from 'vs/platform/update/common/update';
-import { IMainProcessService } from 'vs/platform/ipc/electron-browser/mainProcessService';
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
A
Asher 已提交
416
 import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
A
Asher 已提交
417 418
 
 export class UpdateService implements IUpdateService {
A
Asher 已提交
419
@@ -21,8 +21,8 @@ export class UpdateService implements IUpdateService {
A
Asher 已提交
420 421 422 423 424
 
 	private channel: IChannel;
 
-	constructor(@IMainProcessService mainProcessService: IMainProcessService) {
-		this.channel = mainProcessService.getChannel('update');
A
Asher 已提交
425 426
+	constructor(@IRemoteAgentService mainProcessService: IRemoteAgentService) {
+		this.channel = mainProcessService.getConnection()!.getChannel('update');
A
Asher 已提交
427 428 429 430
 
 		// always set this._state as the state changes
 		this.onStateChange(state => this._state = state);
diff --git a/src/vs/platform/update/electron-main/abstractUpdateService.ts b/src/vs/platform/update/electron-main/abstractUpdateService.ts
A
Asher 已提交
431
index 2a1240b1eb..342e9aa51d 100644
A
Asher 已提交
432 433
--- a/src/vs/platform/update/electron-main/abstractUpdateService.ts
+++ b/src/vs/platform/update/electron-main/abstractUpdateService.ts
A
Asher 已提交
434
@@ -6,7 +6,6 @@
A
Asher 已提交
435 436 437 438 439 440 441
 import { Event, Emitter } from 'vs/base/common/event';
 import { timeout } from 'vs/base/common/async';
 import { IConfigurationService, getMigratedSettingValue } from 'vs/platform/configuration/common/configuration';
-import { ILifecycleService } from 'vs/platform/lifecycle/electron-main/lifecycleMain';
 import product from 'vs/platform/product/node/product';
 import { IUpdateService, State, StateType, AvailableForDownload, UpdateType } from 'vs/platform/update/common/update';
 import { IEnvironmentService } from 'vs/platform/environment/common/environment';
A
Asher 已提交
442
@@ -44,7 +43,7 @@ export abstract class AbstractUpdateService implements IUpdateService {
A
Asher 已提交
443 444 445 446 447 448 449 450
 	}
 
 	constructor(
-		@ILifecycleService private readonly lifecycleService: ILifecycleService,
+		_placeholder: any, // To prevent errors from the extending classes.
 		@IConfigurationService protected configurationService: IConfigurationService,
 		@IEnvironmentService private readonly environmentService: IEnvironmentService,
 		@IRequestService protected requestService: IRequestService,
A
Asher 已提交
451
@@ -55,7 +54,7 @@ export abstract class AbstractUpdateService implements IUpdateService {
A
Asher 已提交
452 453 454 455
 			return;
 		}
 
-		if (!product.updateUrl || !product.commit) {
A
Asher 已提交
456
+		if (!product.commit) {
A
Asher 已提交
457 458 459
 			this.logService.info('update#ctor - updates are disabled as there is no update URL');
 			return;
 		}
A
Asher 已提交
460
@@ -86,7 +85,7 @@ export abstract class AbstractUpdateService implements IUpdateService {
A
Asher 已提交
461 462 463 464
 	}
 
 	private getProductQuality(updateMode: string): string | undefined {
-		return updateMode === 'none' ? undefined : product.quality;
A
Asher 已提交
465
+		return updateMode === 'none' ? undefined : 'unused';
A
Asher 已提交
466 467 468
 	}
 
 	private scheduleCheckForUpdates(delay = 60 * 60 * 1000): Promise<void> {
A
Asher 已提交
469
@@ -145,15 +144,15 @@ export abstract class AbstractUpdateService implements IUpdateService {
A
Asher 已提交
470 471 472 473 474 475 476 477
 
 		this.logService.trace('update#quitAndInstall(): before lifecycle quit()');
 
-		this.lifecycleService.quit(true /* from update */).then(vetod => {
-			this.logService.trace(`update#quitAndInstall(): after lifecycle quit() with veto: ${vetod}`);
-			if (vetod) {
-				return;
-			}
A
Asher 已提交
478
+		// this.lifecycleService.quit(true /* from update */).then(vetod => {
A
Asher 已提交
479 480 481 482 483 484 485 486 487 488 489 490
+			// this.logService.trace(`update#quitAndInstall(): after lifecycle quit() with veto: ${vetod}`);
+			// if (vetod) {
+			// 	return;
+			// }
 
 			this.logService.trace('update#quitAndInstall(): running raw#quitAndInstall()');
 			this.doQuitAndInstall();
-		});
+		// });
 
 		return Promise.resolve(undefined);
 	}
A
Asher 已提交
491
diff --git a/src/vs/workbench/browser/dnd.ts b/src/vs/workbench/browser/dnd.ts
A
Asher 已提交
492
index cf1d6b5b60..be8fdb32f7 100644
A
Asher 已提交
493 494
--- a/src/vs/workbench/browser/dnd.ts
+++ b/src/vs/workbench/browser/dnd.ts
A
Asher 已提交
495
@@ -32,6 +32,7 @@ import { IRecentFile } from 'vs/platform/history/common/history';
A
Asher 已提交
496 497
 import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing';
 import { withNullAsUndefined } from 'vs/base/common/types';
A
Asher 已提交
498
 import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
A
Asher 已提交
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520
+import { IUploadService } from 'vs/server/src/upload';
 
 export interface IDraggedResource {
 	resource: URI;
@@ -166,14 +167,15 @@ export class ResourcesDropHandler {
 		@IUntitledEditorService private readonly untitledEditorService: IUntitledEditorService,
 		@IEditorService private readonly editorService: IEditorService,
 		@IConfigurationService private readonly configurationService: IConfigurationService,
-		@IWorkspaceEditingService private readonly workspaceEditingService: IWorkspaceEditingService
+		@IWorkspaceEditingService private readonly workspaceEditingService: IWorkspaceEditingService,
+		@IUploadService private readonly uploadService: IUploadService,
 	) {
 	}
 
 	async handleDrop(event: DragEvent, resolveTargetGroup: () => IEditorGroup | undefined, afterDrop: (targetGroup: IEditorGroup | undefined) => void, targetIndex?: number): Promise<void> {
 		const untitledOrFileResources = extractResources(event).filter(r => this.fileService.canHandleResource(r.resource) || r.resource.scheme === Schemas.untitled);
 		if (!untitledOrFileResources.length) {
-			return;
+			return this.uploadService.handleDrop(event, resolveTargetGroup, afterDrop, targetIndex);
 		}
 
 		// Make the window active to handle the drop properly within
A
Asher 已提交
521
diff --git a/src/vs/workbench/browser/web.main.ts b/src/vs/workbench/browser/web.main.ts
A
Asher 已提交
522
index ede771a03e..bb40fcdd6b 100644
A
Asher 已提交
523 524
--- a/src/vs/workbench/browser/web.main.ts
+++ b/src/vs/workbench/browser/web.main.ts
A
Asher 已提交
525 526 527 528
@@ -43,6 +43,7 @@ import { getThemeTypeSelector, DARK, HIGH_CONTRAST, LIGHT } from 'vs/platform/th
 import { IRequestService } from 'vs/platform/request/common/request';
 import { RequestService } from 'vs/workbench/services/request/browser/requestService';
 import { InMemoryUserDataProvider } from 'vs/workbench/services/userData/common/inMemoryUserDataProvider';
A
Asher 已提交
529
+import { initialize } from 'vs/server/src/client';
A
Asher 已提交
530 531 532
 
 class CodeRendererMain extends Disposable {
 
A
Asher 已提交
533
@@ -57,6 +58,7 @@ class CodeRendererMain extends Disposable {
A
Asher 已提交
534
 
A
Asher 已提交
535 536 537
 	async open(): Promise<void> {
 		const services = await this.initServices();
+		await initialize(services.serviceCollection);
A
Asher 已提交
538
 
A
Asher 已提交
539 540
 		await domContentLoaded();
 		mark('willStartWorkbench');
A
Asher 已提交
541
@@ -150,6 +152,8 @@ class CodeRendererMain extends Disposable {
A
Asher 已提交
542
 			const remoteFileSystemProvider = this._register(new RemoteExtensionsFileSystemProvider(channel, remoteAgentService.getEnvironment()));
A
Asher 已提交
543
 
A
Asher 已提交
544
 			fileService.registerProvider(Schemas.vscodeRemote, remoteFileSystemProvider);
A
Asher 已提交
545
+			fileService.registerProvider(Schemas.codeServer, remoteFileSystemProvider);
A
Asher 已提交
546
+			fileService.registerProvider(Schemas.file, remoteFileSystemProvider);
A
Asher 已提交
547
 
A
Asher 已提交
548 549
 			if (!userDataProvider) {
 				const remoteUserDataUri = this.getRemoteUserDataUri();
A
Asher 已提交
550
diff --git a/src/vs/workbench/browser/web.simpleservices.ts b/src/vs/workbench/browser/web.simpleservices.ts
A
Asher 已提交
551
index 25414d8733..73aca01cd2 100644
A
Asher 已提交
552 553
--- a/src/vs/workbench/browser/web.simpleservices.ts
+++ b/src/vs/workbench/browser/web.simpleservices.ts
A
Asher 已提交
554 555 556 557 558
@@ -38,6 +38,9 @@ import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteA
 import { IExperimentService, IExperiment, ExperimentActionType, ExperimentState } from 'vs/workbench/contrib/experiments/common/experimentService';
 import { ExtensionHostDebugChannelClient, ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc';
 import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
+import { ExtensionManagementChannelClient } from 'vs/platform/extensionManagement/common/extensionManagementIpc';
A
Asher 已提交
559 560
+import { IUploadService, UploadService } from 'vs/server/src/upload';
+registerSingleton(IUploadService, UploadService, true);
A
Asher 已提交
561
 
A
Asher 已提交
562
 //#region Extension Tips
A
Asher 已提交
563
 
A
Asher 已提交
564
@@ -131,7 +134,15 @@ export class SimpleExtensionManagementService implements IExtensionManagementSer
A
Asher 已提交
565 566
 	}
 }
A
Asher 已提交
567
 
A
Asher 已提交
568 569 570 571 572 573 574 575 576 577
-registerSingleton(IExtensionManagementService, SimpleExtensionManagementService);
+// registerSingleton(IExtensionManagementService, SimpleExtensionManagementService);
+class LocalExtensionManagementService extends ExtensionManagementChannelClient {
+	public constructor(
+		@IRemoteAgentService remoteAgentService: IRemoteAgentService,
+	) {
+		super(remoteAgentService.getConnection()!.getChannel('extensions'));
+	}
+}
+registerSingleton(IExtensionManagementService, LocalExtensionManagementService);
A
Asher 已提交
578
 
A
Asher 已提交
579
 //#endregion
A
Asher 已提交
580
 
A
Asher 已提交
581
@@ -251,7 +262,7 @@ export class SimpleUpdateService implements IUpdateService {
A
Asher 已提交
582 583 584 585 586 587 588 589
 	}
 }
 
-registerSingleton(IUpdateService, SimpleUpdateService);
+// registerSingleton(IUpdateService, SimpleUpdateService);
 
 //#endregion
 
A
Asher 已提交
590
@@ -491,7 +502,7 @@ export class SimpleWindowService extends Disposable implements IWindowService {
A
Asher 已提交
591 592 593
 		for (let i = 0; i < _uris.length; i++) {
 			const uri = _uris[i];
 			if ('folderUri' in uri) {
A
Asher 已提交
594 595
-				const newAddress = `${document.location.origin}/?folder=${uri.folderUri.path}${this.workbenchEnvironmentService.configuration.connectionToken ? `&tkn=${this.workbenchEnvironmentService.configuration.connectionToken}` : ''}`;
+				const newAddress = `${window.location}/?folder=${uri.folderUri.path}${this.workbenchEnvironmentService.configuration.connectionToken ? `&tkn=${this.workbenchEnvironmentService.configuration.connectionToken}` : ''}`;
A
Asher 已提交
596 597 598
 				if (openFolderInNewWindow) {
 					window.open(newAddress);
 				} else {
A
Asher 已提交
599
@@ -499,7 +510,7 @@ export class SimpleWindowService extends Disposable implements IWindowService {
A
Asher 已提交
600 601 602 603
 				}
 			}
 			if ('workspaceUri' in uri) {
-				const newAddress = `${document.location.origin}/?workspace=${uri.workspaceUri.path}`;
A
Asher 已提交
604
+				const newAddress = `${window.location}/?workspace=${uri.workspaceUri.path}`;
A
Asher 已提交
605 606 607
 				if (openFolderInNewWindow) {
 					window.open(newAddress);
 				} else {
A
Asher 已提交
608
@@ -718,6 +729,7 @@ export class SimpleWindowsService implements IWindowsService {
A
Asher 已提交
609 610 611 612 613 614 615
 	}
 
 	relaunch(_options: { addArgs?: string[], removeArgs?: string[] }): Promise<void> {
+		window.location.reload();
 		return Promise.resolve();
 	}
 
A
Asher 已提交
616 617 618 619 620
diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts
index d29d891120..6550d32c42 100644
--- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts
+++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts
@@ -8,7 +8,7 @@ import { localize } from 'vs/nls';
A
Asher 已提交
621
 import * as marked from 'vs/base/common/marked/marked';
A
Asher 已提交
622 623 624 625 626 627 628 629
 import { createCancelablePromise } from 'vs/base/common/async';
 import * as arrays from 'vs/base/common/arrays';
-import { OS } from 'vs/base/common/platform';
+import { OS, OperatingSystem } from 'vs/base/common/platform';
 import { Event, Emitter } from 'vs/base/common/event';
 import { Cache, CacheResult } from 'vs/base/common/cache';
 import { Action } from 'vs/base/common/actions';
@@ -60,7 +60,7 @@ function renderBody(body: string): string {
A
Asher 已提交
630 631 632 633
 		<html>
 			<head>
 				<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
-				<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src https: data:; media-src https:; script-src 'none'; style-src vscode-resource:; child-src 'none'; frame-src 'none';">
A
Asher 已提交
634
+				<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src https: data:; media-src https:; script-src 'none'; style-src 'self'; child-src 'none'; frame-src 'none';">
A
Asher 已提交
635 636 637
 				<link rel="stylesheet" type="text/css" href="${styleSheetPath}">
 			</head>
 			<body>
A
Asher 已提交
638 639 640 641 642 643 644 645 646 647 648 649
@@ -1076,10 +1076,10 @@ export class ExtensionEditor extends BaseEditor {
 	private resolveKeybinding(rawKeyBinding: IKeyBinding): ResolvedKeybinding | null {
 		let key: string | undefined;
 
-		switch (process.platform) {
-			case 'win32': key = rawKeyBinding.win; break;
-			case 'linux': key = rawKeyBinding.linux; break;
-			case 'darwin': key = rawKeyBinding.mac; break;
+		switch (OS) {
+			case OperatingSystem.Windows: key = rawKeyBinding.win; break;
+			case OperatingSystem.Linux: key = rawKeyBinding.linux; break;
+			case OperatingSystem.Macintosh: key = rawKeyBinding.mac; break;
A
Asher 已提交
650
 		}
A
Asher 已提交
651
 
A
Asher 已提交
652
 		const keyBinding = KeybindingParser.parseKeybinding(key || rawKeyBinding.key, OS);
A
Asher 已提交
653
diff --git a/src/vs/workbench/contrib/files/browser/files.contribution.ts b/src/vs/workbench/contrib/files/browser/files.contribution.ts
A
Asher 已提交
654
index b219a608bd..f35f5fa410 100644
A
Asher 已提交
655 656
--- a/src/vs/workbench/contrib/files/browser/files.contribution.ts
+++ b/src/vs/workbench/contrib/files/browser/files.contribution.ts
A
Asher 已提交
657
@@ -224,7 +224,7 @@ configurationRegistry.registerConfiguration({
A
Asher 已提交
658 659 660 661 662 663 664 665 666
 		'files.exclude': {
 			'type': 'object',
 			'markdownDescription': nls.localize('exclude', "Configure glob patterns for excluding files and folders. For example, the files explorer decides which files and folders to show or hide based on this setting. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options)."),
-			'default': { '**/.git': true, '**/.svn': true, '**/.hg': true, '**/CVS': true, '**/.DS_Store': true },
+			'default': { '**/.git': true, '**/.svn': true, '**/.hg': true, '**/CVS': true, '**/.DS_Store': true, '**/.code-server-partial-upload-*': true },
 			'scope': ConfigurationScope.RESOURCE,
 			'additionalProperties': {
 				'anyOf': [
diff --git a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts
A
Asher 已提交
667
index 6543070e81..3d2780f1ba 100644
A
Asher 已提交
668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695
--- a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts
+++ b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts
@@ -46,6 +46,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
 import { IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces';
 import { findValidPasteFileTarget } from 'vs/workbench/contrib/files/browser/fileActions';
 import { FuzzyScore, createMatches } from 'vs/base/common/filters';
+import { IUploadService } from 'vs/server/src/upload';
 
 export class ExplorerDelegate implements IListVirtualDelegate<ExplorerItem> {
 
@@ -453,7 +454,8 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
 		@IInstantiationService private instantiationService: IInstantiationService,
 		@ITextFileService private textFileService: ITextFileService,
 		@IWindowService private windowService: IWindowService,
-		@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService
+		@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService,
+		@IUploadService private readonly uploadService: IUploadService,
 	) {
 		this.toDispose = [];
 
@@ -615,6 +617,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
 
 
 	private async handleExternalDrop(data: DesktopDragAndDropData, target: ExplorerItem, originalEvent: DragEvent): Promise<void> {
+		return this.uploadService.handleExternalDrop(data, target, originalEvent);
 		const droppedResources = extractResources(originalEvent, true);
 		// Check for dropped external files to be folders
 		const result = await this.fileService.resolveAll(droppedResources);
A
Asher 已提交
696 697 698 699 700 701 702 703 704 705 706 707 708 709
diff --git a/src/vs/workbench/contrib/remote/common/remote.contribution.ts b/src/vs/workbench/contrib/remote/common/remote.contribution.ts
index 9235c739fb..32d203eb32 100644
--- a/src/vs/workbench/contrib/remote/common/remote.contribution.ts
+++ b/src/vs/workbench/contrib/remote/common/remote.contribution.ts
@@ -55,7 +55,8 @@ class RemoteChannelsContribution extends Disposable implements IWorkbenchContrib
 		const connection = remoteAgentService.getConnection();
 		if (connection) {
 			const logLevelClient = new LogLevelSetterChannelClient(connection.getChannel('loglevel'));
-			logLevelClient.setLevel(logService.getLevel());
+			logLevelClient.getLevel().then((level) => logService.setLevel(level));
+			logLevelClient.onDidChangeLogLevel((level) => logService.setLevel(level));
 			this._register(logService.onDidChangeLogLevel(level => logLevelClient.setLevel(level)));
 		}
 	}
A
Asher 已提交
710
diff --git a/src/vs/workbench/contrib/update/electron-browser/update.contribution.ts b/src/vs/workbench/contrib/update/electron-browser/update.contribution.ts
A
Asher 已提交
711
index e39fa57979..3c775c9a06 100644
A
Asher 已提交
712 713
--- a/src/vs/workbench/contrib/update/electron-browser/update.contribution.ts
+++ b/src/vs/workbench/contrib/update/electron-browser/update.contribution.ts
A
Asher 已提交
714
@@ -4,26 +4,11 @@
A
Asher 已提交
715 716 717 718 719 720 721 722 723
  *--------------------------------------------------------------------------------------------*/
 
 import 'vs/platform/update/node/update.config.contribution';
-import * as platform from 'vs/base/common/platform';
 import { Registry } from 'vs/platform/registry/common/platform';
 import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions';
-import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions';
-import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
-import { ShowCurrentReleaseNotesAction, ProductContribution, UpdateContribution, Win3264BitContribution } from './update';
A
Asher 已提交
724
+import { UpdateContribution } from './update';
A
Asher 已提交
725 726 727 728 729
 import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
 
 const workbench = Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench);
 
-workbench.registerWorkbenchContribution(ProductContribution, LifecyclePhase.Restored);
A
Asher 已提交
730 731 732 733 734
-
-if (platform.isWindows) {
-	if (process.arch === 'ia32') {
-		workbench.registerWorkbenchContribution(Win3264BitContribution, LifecyclePhase.Restored);
-	}
A
Asher 已提交
735
-}
A
Asher 已提交
736
-
A
Asher 已提交
737
 workbench.registerWorkbenchContribution(UpdateContribution, LifecyclePhase.Restored);
A
Asher 已提交
738 739
-
-// Editor
A
Asher 已提交
740 741 742
-Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions)
-	.registerWorkbenchAction(new SyncActionDescriptor(ShowCurrentReleaseNotesAction, ShowCurrentReleaseNotesAction.ID, ShowCurrentReleaseNotesAction.LABEL), 'Show Release Notes');
diff --git a/src/vs/workbench/contrib/update/electron-browser/update.ts b/src/vs/workbench/contrib/update/electron-browser/update.ts
A
Asher 已提交
743
index 0d2d53003b..03489411bb 100644
A
Asher 已提交
744 745
--- a/src/vs/workbench/contrib/update/electron-browser/update.ts
+++ b/src/vs/workbench/contrib/update/electron-browser/update.ts
A
Asher 已提交
746
@@ -7,34 +7,24 @@ import * as nls from 'vs/nls';
A
Asher 已提交
747 748
 import severity from 'vs/base/common/severity';
 import { Action } from 'vs/base/common/actions';
A
Asher 已提交
749
 import { Disposable, MutableDisposable } from 'vs/base/common/lifecycle';
A
Asher 已提交
750 751 752 753 754 755 756 757 758 759 760
-import pkg from 'vs/platform/product/node/package';
-import product from 'vs/platform/product/node/product';
-import { URI } from 'vs/base/common/uri';
 import { IActivityService, NumberBadge, IBadge, ProgressBadge } from 'vs/workbench/services/activity/common/activity';
-import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
+// import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
 import { GLOBAL_ACTIVITY_ID } from 'vs/workbench/common/activity';
-import { IOpenerService } from 'vs/platform/opener/common/opener';
 import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
 import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
 import { IUpdateService, State as UpdateState, StateType, IUpdate } from 'vs/platform/update/common/update';
A
Asher 已提交
761
-import * as semver from 'semver-umd';
A
Asher 已提交
762 763 764 765 766 767 768 769 770 771 772
-import { IEnvironmentService } from 'vs/platform/environment/common/environment';
 import { INotificationService, INotificationHandle, Severity } from 'vs/platform/notification/common/notification';
 import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
 import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
-import { ReleaseNotesManager } from './releaseNotesEditor';
-import { isWindows } from 'vs/base/common/platform';
-import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
 import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
 import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
 import { CommandsRegistry } from 'vs/platform/commands/common/commands';
 import { FalseContext } from 'vs/platform/contextkey/common/contextkeys';
A
Asher 已提交
773 774
-import { ShowCurrentReleaseNotesActionId } from 'vs/workbench/contrib/update/common/update';
-import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows';
A
Asher 已提交
775 776 777 778 779 780 781 782 783
+import { IProductService } from 'vs/platform/product/common/product';
 
 const CONTEXT_UPDATE_STATE = new RawContextKey<string>('updateState', StateType.Uninitialized);
 
-let releaseNotesManager: ReleaseNotesManager | undefined = undefined;
+/*let releaseNotesManager: ReleaseNotesManager | undefined = undefined;
 
 function showReleaseNotes(instantiationService: IInstantiationService, version: string) {
 	if (!releaseNotesManager) {
A
Asher 已提交
784 785 786
@@ -160,7 +150,7 @@ export class ProductContribution implements IWorkbenchContribution {
 			storageService.store(ProductContribution.KEY, pkg.version, StorageScope.GLOBAL);
 		});
A
Asher 已提交
787 788 789 790 791 792
 	}
-}
+} */
 
 class NeverShowAgain {
 
A
Asher 已提交
793
@@ -185,7 +175,7 @@ class NeverShowAgain {
A
Asher 已提交
794 795 796 797
 	}
 }
 
-export class Win3264BitContribution implements IWorkbenchContribution {
A
Asher 已提交
798
+/*export class Win3264BitContribution implements IWorkbenchContribution {
A
Asher 已提交
799 800 801
 
 	private static readonly KEY = 'update/win32-64bits';
 	private static readonly URL = 'https://code.visualstudio.com/updates/v1_15#_windows-64-bit';
A
Asher 已提交
802
@@ -224,7 +214,7 @@ export class Win3264BitContribution implements IWorkbenchContribution {
A
Asher 已提交
803 804 805 806
 			{ sticky: true }
 		);
 	}
-}
A
Asher 已提交
807
+}*/
A
Asher 已提交
808 809 810
 
 export class UpdateContribution extends Disposable implements IWorkbenchContribution {
 
A
Asher 已提交
811
@@ -234,13 +224,14 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
A
Asher 已提交
812 813 814 815 816 817 818 819
 
 	constructor(
 		@IStorageService private readonly storageService: IStorageService,
-		@IInstantiationService private readonly instantiationService: IInstantiationService,
+		// @IInstantiationService private readonly instantiationService: IInstantiationService,
 		@INotificationService private readonly notificationService: INotificationService,
 		@IDialogService private readonly dialogService: IDialogService,
 		@IUpdateService private readonly updateService: IUpdateService,
A
Asher 已提交
820 821 822 823 824 825 826 827 828
 		@IActivityService private readonly activityService: IActivityService,
 		@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
-		@IContextKeyService private readonly contextKeyService: IContextKeyService
+		@IContextKeyService private readonly contextKeyService: IContextKeyService,
+		@IProductService private readonly productService: IProductService,
 	) {
 		super();
 		this.state = updateService.state;
@@ -257,7 +248,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
A
Asher 已提交
829 830 831 832 833 834 835 836
 		updated since 5 days.
 		*/
 
-		const currentVersion = product.commit;
+		const currentVersion = this.productService.commit;
 		const lastKnownVersion = this.storageService.get('update/lastKnownVersion', StorageScope.GLOBAL);
 
 		// if current version != stored version, clear both fields
A
Asher 已提交
837
@@ -302,9 +293,9 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
A
Asher 已提交
838 839 840 841 842 843 844 845 846 847 848
 		let clazz: string | undefined;
 
 		if (state.type === StateType.AvailableForDownload || state.type === StateType.Downloaded || state.type === StateType.Ready) {
-			badge = new NumberBadge(1, () => nls.localize('updateIsReady', "New {0} update available.", product.nameShort));
+			badge = new NumberBadge(1, () => nls.localize('updateIsReady', "New {0} update available.", this.productService.nameLong));
 		} else if (state.type === StateType.CheckingForUpdates || state.type === StateType.Downloading || state.type === StateType.Updating) {
-			badge = new ProgressBadge(() => nls.localize('updateIsReady', "New {0} update available.", product.nameShort));
+			badge = new ProgressBadge(() => nls.localize('updateIsReady', "New {0} update available.", this.productService.nameLong));
 			clazz = 'progress-badge';
 		}
 
A
Asher 已提交
849
@@ -350,14 +341,14 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
A
Asher 已提交
850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865
 			}, {
 				label: nls.localize('later', "Later"),
 				run: () => { }
-			}, {
+			}/*, {
 				label: nls.localize('releaseNotes', "Release Notes"),
 				run: () => {
 					const action = this.instantiationService.createInstance(ShowReleaseNotesAction, update.productVersion);
 					action.run();
 					action.dispose();
 				}
-			}],
+			}*/],
 			{ sticky: true }
 		);
 	}
A
Asher 已提交
866
@@ -370,30 +361,27 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
A
Asher 已提交
867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899
 
 		this.notificationService.prompt(
 			severity.Info,
-			nls.localize('updateAvailable', "There's an update available: {0} {1}", product.nameLong, update.productVersion),
+			nls.localize('updateAvailable', "There's an update available: {0} {1}", this.productService.nameLong, update.productVersion),
 			[{
 				label: nls.localize('installUpdate', "Install Update"),
 				run: () => this.updateService.applyUpdate()
 			}, {
 				label: nls.localize('later', "Later"),
 				run: () => { }
-			}, {
+			}/*, {
 				label: nls.localize('releaseNotes', "Release Notes"),
 				run: () => {
 					const action = this.instantiationService.createInstance(ShowReleaseNotesAction, update.productVersion);
 					action.run();
 					action.dispose();
 				}
-			}],
+			}*/],
 			{ sticky: true }
 		);
 	}
 
 	// windows fast updates
 	private onUpdateUpdating(update: IUpdate): void {
-		if (isWindows && product.target === 'user') {
-			return;
-		}
 
 		// windows fast updates (target === system)
 		const neverShowAgain = new NeverShowAgain('update/win32-fast-updates', this.storageService);
A
Asher 已提交
900
@@ -404,7 +392,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
A
Asher 已提交
901 902 903 904 905 906 907 908
 
 		const handle = this.notificationService.prompt(
 			severity.Info,
-			nls.localize('updateInstalling', "{0} {1} is being installed in the background; we'll let you know when it's done.", product.nameLong, update.productVersion),
+			nls.localize('updateInstalling', "{0} {1} is being installed in the background; we'll let you know when it's done.", this.productService.nameLong, update.productVersion),
 			[{
 				label: nls.localize('neveragain', "Don't Show Again"),
 				isSecondary: true,
A
Asher 已提交
909
@@ -418,20 +406,17 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
A
Asher 已提交
910 911 912 913 914 915 916 917 918 919
 
 	// windows and mac
 	private onUpdateReady(update: IUpdate): void {
-		if (!(isWindows && product.target !== 'user') && !this.shouldShowNotification()) {
-			return;
-		}
 
 		const actions = [{
 			label: nls.localize('updateNow', "Update Now"),
-			run: () => this.updateService.quitAndInstall()
A
Asher 已提交
920
+			run: () => { this.updateService.quitAndInstall(); window.location.reload(); }
A
Asher 已提交
921 922 923 924 925 926 927 928 929 930 931
 		}, {
 			label: nls.localize('later', "Later"),
 			run: () => { }
 		}];
 
 		// TODO@joao check why snap updates send `update` as falsy
-		if (update.productVersion) {
+		/*if (update.productVersion) {
 			actions.push({
 				label: nls.localize('releaseNotes', "Release Notes"),
 				run: () => {
A
Asher 已提交
932
@@ -440,19 +425,19 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
A
Asher 已提交
933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954
 					action.dispose();
 				}
 			});
-		}
+		}*/
 
 		// windows user fast updates and mac
 		this.notificationService.prompt(
 			severity.Info,
-			nls.localize('updateAvailableAfterRestart', "Restart {0} to apply the latest update.", product.nameLong),
+			nls.localize('updateAvailableAfterRestart', "Restart {0} to apply the latest update.", this.productService.nameLong),
 			actions,
 			{ sticky: true }
 		);
 	}
 
 	private shouldShowNotification(): boolean {
-		const currentVersion = product.commit;
+		const currentVersion = this.productService.commit;
 		const currentMillis = new Date().getTime();
 		const lastKnownVersion = this.storageService.get('update/lastKnownVersion', StorageScope.GLOBAL);
 
A
Asher 已提交
955
@@ -495,7 +480,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
A
Asher 已提交
956 957 958 959 960 961 962 963
 			group: '5_update',
 			command: {
 				id: 'update.downloadNow',
-				title: nls.localize('download update', "Download Update")
+				title: nls.localize('installUpdate...', "Install Update...")
 			},
 			when: CONTEXT_UPDATE_STATE.isEqualTo(StateType.AvailableForDownload)
 		});
A
Asher 已提交
964
@@ -532,7 +517,7 @@ export class UpdateContribution extends Disposable implements IWorkbenchContribu
A
Asher 已提交
965 966 967 968
 			when: CONTEXT_UPDATE_STATE.isEqualTo(StateType.Updating)
 		});
 
-		CommandsRegistry.registerCommand('update.restart', () => this.updateService.quitAndInstall());
A
Asher 已提交
969
+		CommandsRegistry.registerCommand('update.restart', () => { this.updateService.quitAndInstall(); window.location.reload(); });
A
Asher 已提交
970 971 972
 		MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
 			group: '5_update',
 			command: {
A
Asher 已提交
973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992
diff --git a/src/vs/workbench/contrib/webview/browser/pre/index.html b/src/vs/workbench/contrib/webview/browser/pre/index.html
index ac53ce590e..2ce2b9d9f2 100644
--- a/src/vs/workbench/contrib/webview/browser/pre/index.html
+++ b/src/vs/workbench/contrib/webview/browser/pre/index.html
@@ -4,7 +4,7 @@
 <head>
 	<meta charset="UTF-8">
 	<meta http-equiv="Content-Security-Policy"
-		content="default-src 'none'; script-src 'self'; frame-src 'self'; style-src 'unsafe-inline'; worker-src 'self';" />
+		content="default-src 'none'; script-src 'self'; frame-src 'self'; style-src 'self' 'unsafe-inline'; worker-src 'self'; img-src https: data:;" />
 
 	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 	<meta http-equiv="X-UA-Compatible" content="ie=edge">
@@ -16,4 +16,4 @@
 	<script src="host.js"></script>
 </body>
 
-</html>
\ No newline at end of file
+</html>
A
Asher 已提交
993
diff --git a/src/vs/workbench/services/environment/browser/environmentService.ts b/src/vs/workbench/services/environment/browser/environmentService.ts
A
Asher 已提交
994
index 73e8b7c1d1..653d88e4f4 100644
A
Asher 已提交
995 996
--- a/src/vs/workbench/services/environment/browser/environmentService.ts
+++ b/src/vs/workbench/services/environment/browser/environmentService.ts
A
Asher 已提交
997
@@ -176,6 +176,8 @@ export class BrowserWorkbenchEnvironmentService implements IEnvironmentService {
A
Asher 已提交
998 999
 	driverVerbose: boolean;
 	webviewEndpoint?: string;
A
Asher 已提交
1000
 	galleryMachineIdResource?: URI;
A
Asher 已提交
1001 1002 1003 1004
+	extraExtensionPaths: string[];
+	extraBuiltinExtensionPaths: string[];
 
 	get webviewResourceRoot(): string {
A
Asher 已提交
1005
 		return this.webviewEndpoint ? this.webviewEndpoint + '/vscode-resource{{resource}}' : 'vscode-resource:{{resource}}';
A
Asher 已提交
1006
diff --git a/src/vs/workbench/workbench.web.main.ts b/src/vs/workbench/workbench.web.main.ts
A
Asher 已提交
1007
index 4d5cf7bfbf..bc76a25106 100644
A
Asher 已提交
1008 1009
--- a/src/vs/workbench/workbench.web.main.ts
+++ b/src/vs/workbench/workbench.web.main.ts
A
Asher 已提交
1010
@@ -126,7 +126,6 @@ import 'vs/workbench/services/extensionManagement/common/extensionEnablementServ
A
Asher 已提交
1011 1012 1013
 // import 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl';
 import 'vs/workbench/services/notification/common/notificationService';
 // import 'vs/workbench/services/window/electron-browser/windowService';
A
Asher 已提交
1014 1015 1016 1017 1018
-import 'vs/workbench/services/telemetry/browser/telemetryService';
 import 'vs/workbench/services/configurationResolver/browser/configurationResolverService';
 import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView';
 import { ContextMenuService } from 'vs/platform/contextview/browser/contextMenuService';
@@ -195,7 +194,7 @@ import 'vs/workbench/services/files/common/workspaceWatcher';
A
Asher 已提交
1019 1020 1021 1022 1023 1024 1025 1026
 import 'vs/workbench/contrib/telemetry/browser/telemetry.contribution';
 
 // Localizations
-// import 'vs/workbench/contrib/localizations/browser/localizations.contribution';
+import 'vs/workbench/contrib/localizations/browser/localizations.contribution';
 
 // Preferences
 import 'vs/workbench/contrib/preferences/browser/preferences.contribution';