1
+ diff --git a/.eslintrc.json b/.eslintrc.json
2
+ index 055bc22f8e48e7dee559b83ac56c12a54c6ad544..14c026c04a7df5ac94bea2856e3a7a513c213775 100644
3
+ --- a/.eslintrc.json
4
+ +++ b/.eslintrc.json
5
+ @@ -64,7 +64,7 @@
6
+ "code-no-standalone-editor": "warn",
7
+ "code-no-unexternalized-strings": "warn",
8
+ "code-layering": [
9
+ - "warn",
10
+ + "off",
11
+ {
12
+ "common": [],
13
+ "node": [
14
+ @@ -90,7 +90,7 @@
15
+ }
16
+ ],
17
+ "code-import-patterns": [
18
+ - "warn",
19
+ + "off",
20
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
21
+ // !!! Do not relax these rules !!!
22
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1
23
diff --git a/.gitignore b/.gitignore
2
24
index b7f5b58c8ede171be547c56b61ce76f79a3accc3..856fbd8c67460fe099d7fbee1475e906b500f053 100644
3
25
--- a/.gitignore
@@ -437,7 +459,7 @@ index ef2291d49b13c9c995afc90eab9c92afabc2b3b4..29b2f9dfc2b7fa998ac1188db06dee95
437
459
\ No newline at end of file
438
460
+ }
439
461
diff --git a/src/vs/base/node/languagePacks.js b/src/vs/base/node/languagePacks.js
440
- index 2c64061da7b01aef0bfe3cec851da232ca9461c8..c0ef8faedd406c38bf9c55bbbdbbb060046492d9 100644
462
+ index 2c64061da7b01aef0bfe3cec851da232ca9461c8..db47fe2eb1cded1e9c33b42fe700421c36a1d481 100644
441
463
--- a/src/vs/base/node/languagePacks.js
442
464
+++ b/src/vs/base/node/languagePacks.js
443
465
@@ -128,7 +128,10 @@ function factory(nodeRequire, path, fs, perf) {
@@ -448,12 +470,12 @@ index 2c64061da7b01aef0bfe3cec851da232ca9461c8..c0ef8faedd406c38bf9c55bbbdbbb060
448
470
+ // NOTE@coder: Swapped require with readFile since require is cached and
449
471
+ // we don't restart the server-side portion of code-server when the
450
472
+ // language changes.
451
- + return JSON.parse(fs.readFileSync(configFile, " utf8" ));
473
+ + return JSON.parse(fs.readFileSync(configFile, ' utf8' ));
452
474
} catch (err) {
453
475
// Do nothing. If we can't read the file we have no
454
476
// language pack config.
455
477
diff --git a/src/vs/code/browser/workbench/workbench.ts b/src/vs/code/browser/workbench/workbench.ts
456
- index 0ef8b9dc81419b53b27cf111fb206d72ba56bada..62a79602a831bca0dc62ad57dc10a9375f8b9cdb 100644
478
+ index 0ef8b9dc81419b53b27cf111fb206d72ba56bada..e490cf7449623f96c780a65d538fad72cf9306e4 100644
457
479
--- a/src/vs/code/browser/workbench/workbench.ts
458
480
+++ b/src/vs/code/browser/workbench/workbench.ts
459
481
@@ -17,6 +17,7 @@ import { isStandalone } from 'vs/base/browser/browser';
@@ -496,7 +518,7 @@ index 0ef8b9dc81419b53b27cf111fb206d72ba56bada..62a79602a831bca0dc62ad57dc10a937
496
518
+ };
497
519
+
498
520
+ // Strip the protocol from the authority if it exists.
499
- + const normalizeAuthority = (authority: string): string => authority.replace(/^https?:\/\//, "" );
521
+ + const normalizeAuthority = (authority: string): string => authority.replace(/^https?:\/\//, '' );
500
522
+ if (config.remoteAuthority) {
501
523
+ (config as any).remoteAuthority = normalizeAuthority(config.remoteAuthority);
502
524
+ }
@@ -788,7 +810,7 @@ index 096b9e23493539c9937940a56e555d95bbae38d9..ef37e614004f550f7b64eacd362f6894
788
810
remove(key: string, scope: StorageScope): void {
789
811
diff --git a/src/vs/server/browser/client.ts b/src/vs/server/browser/client.ts
790
812
new file mode 100644
791
- index 0000000000000000000000000000000000000000..385b9da491d38a9f5d10fab6e4666c84a892f49d
813
+ index 0000000000000000000000000000000000000000..ead6a3cd5e98fdde074f19ee5043f152ed407146
792
814
--- /dev/null
793
815
+++ b/src/vs/server/browser/client.ts
794
816
@@ -0,0 +1,240 @@
@@ -825,15 +847,15 @@ index 0000000000000000000000000000000000000000..385b9da491d38a9f5d10fab6e4666c84
825
847
+ * Remove extra slashes in a URL.
826
848
+ */
827
849
+ export const normalize = (url: string, keepTrailing = false): string => {
828
- + return url.replace(/\/\/+/g, "/" ).replace(/\/+$/, keepTrailing ? "/" : "" );
850
+ + return url.replace(/\/\/+/g, '/' ).replace(/\/+$/, keepTrailing ? '/' : '' );
829
851
+ };
830
852
+
831
853
+ /**
832
854
+ * Get options embedded in the HTML.
833
855
+ */
834
856
+ export const getOptions = <T extends Options>(): T => {
835
857
+ try {
836
- + return JSON.parse(document.getElementById(" coder-options" )!.getAttribute(" data-settings" )!);
858
+ + return JSON.parse(document.getElementById(' coder-options' )!.getAttribute(' data-settings' )!);
837
859
+ } catch (error) {
838
860
+ return {} as T;
839
861
+ }
@@ -946,12 +968,12 @@ index 0000000000000000000000000000000000000000..385b9da491d38a9f5d10fab6e4666c84
946
968
+ const logService = (services.get(ILogService) as ILogService);
947
969
+ const storageService = (services.get(IStorageService) as IStorageService);
948
970
+ // We set this here first in case the path changes.
949
- + const updateCheckEndpoint = path.join(window.location.pathname, " /update/check")
971
+ + const updateCheckEndpoint = path.join(window.location.pathname, ' /update/check');
950
972
+ const getUpdate = async (): Promise<void> => {
951
- + logService.debug(" Checking for update..." );
973
+ + logService.debug(' Checking for update...' );
952
974
+
953
975
+ const response = await fetch(updateCheckEndpoint, {
954
- + headers: { " Accept": " application/json" },
976
+ + headers: { ' Accept': ' application/json' },
955
977
+ });
956
978
+ if (!response.ok) {
957
979
+ throw new Error(response.statusText);
@@ -964,7 +986,7 @@ index 0000000000000000000000000000000000000000..385b9da491d38a9f5d10fab6e4666c84
964
986
+ return;
965
987
+ }
966
988
+
967
- + const lastNoti = storageService.getNumber(" csLastUpdateNotification" , StorageScope.GLOBAL);
989
+ + const lastNoti = storageService.getNumber(' csLastUpdateNotification' , StorageScope.GLOBAL);
968
990
+ if (lastNoti) {
969
991
+ // Only remind them again after two days.
970
992
+ const timeout = 1000*60*24*2;
@@ -974,7 +996,7 @@ index 0000000000000000000000000000000000000000..385b9da491d38a9f5d10fab6e4666c84
974
996
+ }
975
997
+ }
976
998
+
977
- + storageService.store(" csLastUpdateNotification" , Date.now(), StorageScope.GLOBAL);
999
+ + storageService.store(' csLastUpdateNotification' , Date.now(), StorageScope.GLOBAL);
978
1000
+ (services.get(INotificationService) as INotificationService).notify({
979
1001
+ severity: Severity.Info,
980
1002
+ message: `[code-server v${json.latest}](https://github.com/cdr/code-server/releases/tag/v${json.latest}) has been released!`,
@@ -993,9 +1015,9 @@ index 0000000000000000000000000000000000000000..385b9da491d38a9f5d10fab6e4666c84
993
1015
+ updateLoop();
994
1016
+
995
1017
+ // This will be used to set the background color while VS Code loads.
996
- + const theme = storageService.get(" colorThemeData" , StorageScope.GLOBAL);
1018
+ + const theme = storageService.get(' colorThemeData' , StorageScope.GLOBAL);
997
1019
+ if (theme) {
998
- + localStorage.setItem(" colorThemeData" , theme);
1020
+ + localStorage.setItem(' colorThemeData' , theme);
999
1021
+ }
1000
1022
+ };
1001
1023
+
@@ -1091,7 +1113,7 @@ index 0000000000000000000000000000000000000000..5dd5406befcb593ad6366d9e98f46485
1091
1113
+ export const IExtHostNodeProxy = createDecorator<IExtHostNodeProxy>('IExtHostNodeProxy');
1092
1114
diff --git a/src/vs/server/browser/mainThreadNodeProxy.ts b/src/vs/server/browser/mainThreadNodeProxy.ts
1093
1115
new file mode 100644
1094
- index 0000000000000000000000000000000000000000..21a139288e5b8f56016491879d69d01da929decb
1116
+ index 0000000000000000000000000000000000000000..acabf8c167cabc954b8611a77f57641f3ca0b444
1095
1117
--- /dev/null
1096
1118
+++ b/src/vs/server/browser/mainThreadNodeProxy.ts
1097
1119
@@ -0,0 +1,55 @@
@@ -1134,7 +1156,7 @@ index 0000000000000000000000000000000000000000..21a139288e5b8f56016491879d69d01d
1134
1156
+ scheme: window.location.protocol.replace(':', ''),
1135
1157
+ authority: window.location.host,
1136
1158
+ // Use FileAccess to get the static base path.
1137
- + path: FileAccess.asBrowserUri("" , require).path,
1159
+ + path: FileAccess.asBrowserUri('' , require).path,
1138
1160
+ query: `tar=${encodeURIComponent(extensionUri.path)}`,
1139
1161
+ });
1140
1162
+ const response = await fetch(fetchUri.toString(true));
@@ -1424,7 +1446,7 @@ index 0000000000000000000000000000000000000000..56331ff1fc32bbd82e769aaecb551e42
1424
1446
+ require('../../bootstrap-amd').load('vs/server/entry');
1425
1447
diff --git a/src/vs/server/ipc.d.ts b/src/vs/server/ipc.d.ts
1426
1448
new file mode 100644
1427
- index 0000000000000000000000000000000000000000..6ce56bec114a6d8daf5dd3ded945ea78fc72a5c6
1449
+ index 0000000000000000000000000000000000000000..0a4a91e5e36bda7f888feedda348aaff5fe32d27
1428
1450
--- /dev/null
1429
1451
+++ b/src/vs/server/ipc.d.ts
1430
1452
@@ -0,0 +1,131 @@
@@ -1537,8 +1559,8 @@ index 0000000000000000000000000000000000000000..6ce56bec114a6d8daf5dd3ded945ea78
1537
1559
+ readonly logLevel?: number;
1538
1560
+ readonly workspaceProvider?: {
1539
1561
+ payload: [
1540
- + [" userDataPath" , string],
1541
- + [" enableProposedApi" , string],
1562
+ + [' userDataPath' , string],
1563
+ + [' enableProposedApi' , string],
1542
1564
+ ];
1543
1565
+ };
1544
1566
+ };
@@ -1561,7 +1583,7 @@ index 0000000000000000000000000000000000000000..6ce56bec114a6d8daf5dd3ded945ea78
1561
1583
+ }
1562
1584
diff --git a/src/vs/server/node/channel.ts b/src/vs/server/node/channel.ts
1563
1585
new file mode 100644
1564
- index 0000000000000000000000000000000000000000..693174ee0d21353c3a08a42fd30eaad1e95c3b9d
1586
+ index 0000000000000000000000000000000000000000..4827b2da780b66e6dfd65c2a2f1c938cb23f6c26
1565
1587
--- /dev/null
1566
1588
+++ b/src/vs/server/node/channel.ts
1567
1589
@@ -0,0 +1,897 @@
@@ -1995,7 +2017,7 @@ index 0000000000000000000000000000000000000000..693174ee0d21353c3a08a42fd30eaad1
1995
2017
+ class Terminal {
1996
2018
+ private readonly process: TerminalProcess;
1997
2019
+ private _pid: number = -1;
1998
- + private _title: string = "" ;
2020
+ + private _title: string = '' ;
1999
2021
+ public readonly workspaceId: string;
2000
2022
+ public readonly workspaceName: string;
2001
2023
+ private readonly persist: boolean;
@@ -2032,7 +2054,7 @@ index 0000000000000000000000000000000000000000..693174ee0d21353c3a08a42fd30eaad1
2032
2054
+ onFirstListenerDidAdd: () => {
2033
2055
+ // We only need to replay if the terminal is being reconnected which is
2034
2056
+ // true if there is a dispose timeout.
2035
- + if (typeof this.disposeTimeout !== " undefined" ) {
2057
+ + if (typeof this.disposeTimeout !== ' undefined' ) {
2036
2058
+ return;
2037
2059
+ }
2038
2060
+
@@ -2045,7 +2067,7 @@ index 0000000000000000000000000000000000000000..693174ee0d21353c3a08a42fd30eaad1
2045
2067
+ events: [{
2046
2068
+ cols: this.cols,
2047
2069
+ rows: this.rows,
2048
- + data: this.replayData.join("" ),
2070
+ + data: this.replayData.join('' ),
2049
2071
+ }]
2050
2072
+ });
2051
2073
+ },
@@ -2264,15 +2286,15 @@ index 0000000000000000000000000000000000000000..693174ee0d21353c3a08a42fd30eaad1
2264
2286
+
2265
2287
+ private async createTerminalProcess(remoteAuthority: string, args: terminal.ICreateTerminalProcessArguments): Promise<terminal.ICreateTerminalProcessResult> {
2266
2288
+ const terminalId = this.id++;
2267
- + logger.debug('Creating terminal', field('id', terminalId), field(" terminals" , this.terminals.size));
2289
+ + logger.debug('Creating terminal', field('id', terminalId), field(' terminals' , this.terminals.size));
2268
2290
+
2269
2291
+ const shellLaunchConfig: IShellLaunchConfig = {
2270
2292
+ name: args.shellLaunchConfig.name,
2271
2293
+ executable: args.shellLaunchConfig.executable,
2272
2294
+ args: args.shellLaunchConfig.args,
2273
2295
+ // TODO: Should we transform if it's a string as well? The incoming
2274
2296
+ // transform only takes `UriComponents` so I suspect it's not necessary.
2275
- + cwd: typeof args.shellLaunchConfig.cwd !== " string"
2297
+ + cwd: typeof args.shellLaunchConfig.cwd !== ' string'
2276
2298
+ ? transformIncoming(remoteAuthority, args.shellLaunchConfig.cwd)
2277
2299
+ : args.shellLaunchConfig.cwd,
2278
2300
+ env: args.shellLaunchConfig.env,
@@ -2464,7 +2486,7 @@ index 0000000000000000000000000000000000000000..693174ee0d21353c3a08a42fd30eaad1
2464
2486
+ }
2465
2487
diff --git a/src/vs/server/node/connection.ts b/src/vs/server/node/connection.ts
2466
2488
new file mode 100644
2467
- index 0000000000000000000000000000000000000000..5c3caf4d12cbf9b7228699ec4fa40cb406aa6307
2489
+ index 0000000000000000000000000000000000000000..fb7999ee343ddfd5f225a5ef727c9e559059fb58
2468
2490
--- /dev/null
2469
2491
+++ b/src/vs/server/node/connection.ts
2470
2492
@@ -0,0 +1,189 @@
@@ -2562,7 +2584,7 @@ index 0000000000000000000000000000000000000000..5c3caf4d12cbf9b7228699ec4fa40cb4
2562
2584
+ private readonly environment: INativeEnvironmentService,
2563
2585
+ ) {
2564
2586
+ super(protocol, token);
2565
- + this.logger = logger.named(" exthost" , field(" token" , token));
2587
+ + this.logger = logger.named(' exthost' , field(' token' , token));
2566
2588
+ this.protocol.dispose();
2567
2589
+ this.spawn(locale, buffer).then((p) => this.process = p);
2568
2590
+ this.protocol.getUnderlyingSocket().pause();
@@ -2648,7 +2670,7 @@ index 0000000000000000000000000000000000000000..5c3caf4d12cbf9b7228699ec4fa40cb4
2648
2670
+ this.sendInitMessage(buffer);
2649
2671
+ break;
2650
2672
+ default:
2651
- + this.logger.error('Unexpected message', field(" event" , event));
2673
+ + this.logger.error('Unexpected message', field(' event' , event));
2652
2674
+ break;
2653
2675
+ }
2654
2676
+ });
@@ -3138,7 +3160,7 @@ index 0000000000000000000000000000000000000000..3d428a57d31f29c40f9c3ce45f715b44
3138
3160
+ };
3139
3161
diff --git a/src/vs/server/node/protocol.ts b/src/vs/server/node/protocol.ts
3140
3162
new file mode 100644
3141
- index 0000000000000000000000000000000000000000..0d9310038c0ca378579652d89bc8ac84924213db
3163
+ index 0000000000000000000000000000000000000000..57213f92828fafefcab0e3c401a1e8ede472c9cc
3142
3164
--- /dev/null
3143
3165
+++ b/src/vs/server/node/protocol.ts
3144
3166
@@ -0,0 +1,91 @@
@@ -3180,7 +3202,7 @@ index 0000000000000000000000000000000000000000..0d9310038c0ca378579652d89bc8ac84
3180
3202
+ return new Promise((resolve, reject) => {
3181
3203
+ const timeout = setTimeout(() => {
3182
3204
+ logger.error('Handshake timed out', field('token', this.options.reconnectionToken));
3183
- + reject(new Error(" timed out" ));
3205
+ + reject(new Error(' timed out' ));
3184
3206
+ }, 10000); // Matches the client timeout.
3185
3207
+
3186
3208
+ const handler = this.onControlMessage((rawMessage) => {
@@ -3235,7 +3257,7 @@ index 0000000000000000000000000000000000000000..0d9310038c0ca378579652d89bc8ac84
3235
3257
+ }
3236
3258
diff --git a/src/vs/server/node/server.ts b/src/vs/server/node/server.ts
3237
3259
new file mode 100644
3238
- index 0000000000000000000000000000000000000000..c10a5a3a6771a94b2cbcb699bb1261051c71e08b
3260
+ index 0000000000000000000000000000000000000000..5521d51a92d1b1e3469e890bae41277b560d08a2
3239
3261
--- /dev/null
3240
3262
+++ b/src/vs/server/node/server.ts
3241
3263
@@ -0,0 +1,302 @@
@@ -3249,7 +3271,7 @@ index 0000000000000000000000000000000000000000..c10a5a3a6771a94b2cbcb699bb126105
3249
3271
+ import { getMachineId } from 'vs/base/node/id';
3250
3272
+ import { ClientConnectionEvent, createChannelReceiver, IPCServer, IServerChannel } from 'vs/base/parts/ipc/common/ipc';
3251
3273
+ import { LogsDataCleaner } from 'vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner';
3252
- + import { main } from " vs/code/node/cliProcessMain" ;
3274
+ + import { main } from ' vs/code/node/cliProcessMain' ;
3253
3275
+ import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
3254
3276
+ import { ConfigurationService } from 'vs/platform/configuration/common/configurationService';
3255
3277
+ import { ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc';
@@ -3297,7 +3319,7 @@ index 0000000000000000000000000000000000000000..c10a5a3a6771a94b2cbcb699bb126105
3297
3319
+ import { Protocol } from 'vs/server/node/protocol';
3298
3320
+ import { getUriTransformer } from 'vs/server/node/util';
3299
3321
+ import { REMOTE_TERMINAL_CHANNEL_NAME } from 'vs/workbench/contrib/terminal/common/remoteTerminalChannel';
3300
- + import { REMOTE_FILE_SYSTEM_CHANNEL_NAME } from " vs/workbench/services/remote/common/remoteAgentFileSystemChannel" ;
3322
+ + import { REMOTE_FILE_SYSTEM_CHANNEL_NAME } from ' vs/workbench/services/remote/common/remoteAgentFileSystemChannel' ;
3301
3323
+ import { RemoteExtensionLogFileName } from 'vs/workbench/services/remote/common/remoteAgentService';
3302
3324
+
3303
3325
+ export class Vscode {
@@ -3343,8 +3365,8 @@ index 0000000000000000000000000000000000000000..c10a5a3a6771a94b2cbcb699bb126105
3343
3365
+ logLevel: getLogLevel(environment),
3344
3366
+ workspaceProvider: {
3345
3367
+ payload: [
3346
- + [" userDataPath" , environment.userDataPath],
3347
- + [" enableProposedApi" , JSON.stringify(options.args[" enable-proposed-api" ] || [])]
3368
+ + [' userDataPath' , environment.userDataPath],
3369
+ + [' enableProposedApi' , JSON.stringify(options.args[' enable-proposed-api' ] || [])]
3348
3370
+ ],
3349
3371
+ },
3350
3372
+ },
@@ -3444,7 +3466,7 @@ index 0000000000000000000000000000000000000000..c10a5a3a6771a94b2cbcb699bb126105
3444
3466
+ const offline = Array.from(connections.values())
3445
3467
+ .filter((connection) => typeof connection.offline !== 'undefined');
3446
3468
+ for (let i = 0, max = offline.length - this.maxExtraOfflineConnections; i < max; ++i) {
3447
- + logger.debug('Disposing offline connection', field(" token" , offline[i].token));
3469
+ + logger.debug('Disposing offline connection', field(' token' , offline[i].token));
3448
3470
+ offline[i].dispose();
3449
3471
+ }
3450
3472
+ }
@@ -3543,7 +3565,7 @@ index 0000000000000000000000000000000000000000..c10a5a3a6771a94b2cbcb699bb126105
3543
3565
+ }
3544
3566
diff --git a/src/vs/server/node/util.ts b/src/vs/server/node/util.ts
3545
3567
new file mode 100644
3546
- index 0000000000000000000000000000000000000000..fa47e993b46802f1a26457649e9e8bc467a73bf2
3568
+ index 0000000000000000000000000000000000000000..d76f655e36647b1c9d38d2f7986f2b78a4bcfb50
3547
3569
--- /dev/null
3548
3570
+++ b/src/vs/server/node/util.ts
3549
3571
@@ -0,0 +1,13 @@
@@ -3558,7 +3580,7 @@ index 0000000000000000000000000000000000000000..fa47e993b46802f1a26457649e9e8bc4
3558
3580
+ * preserves slashes so it can be edited by hand more easily.
3559
3581
+ */
3560
3582
+ export const encodePath = (path: string): string => {
3561
- + return path.split("/" ).map((p) => encodeURIComponent(p)).join("/" );
3583
+ + return path.split('/' ).map((p) => encodeURIComponent(p)).join('/' );
3562
3584
+ };
3563
3585
diff --git a/src/vs/workbench/api/browser/extensionHost.contribution.ts b/src/vs/workbench/api/browser/extensionHost.contribution.ts
3564
3586
index a4df8523631563a498c9ab6e51105074616a481a..f03da094e9080544102bbd3f037a71b348e5bd83 100644
@@ -3729,7 +3751,7 @@ index b3c89e51cfc25a53293a352a2a8ad50d5f26d595..e21abe4e13bc25a5b72f556bbfb61085
3729
3751
registerSingleton(IExtHostTunnelService, ExtHostTunnelService);
3730
3752
+ registerSingleton(IExtHostNodeProxy, class extends NotImplementedProxy<IExtHostNodeProxy>(String(IExtHostNodeProxy)) { whenReady = Promise.resolve(); });
3731
3753
diff --git a/src/vs/workbench/api/node/extHostCLIServer.ts b/src/vs/workbench/api/node/extHostCLIServer.ts
3732
- index b3857616f7006127c423dcef7020ae4653da5ff6..1c1b80a2767bf77f30ca5bfee715c337120d3625 100644
3754
+ index b3857616f7006127c423dcef7020ae4653da5ff6..594cd75b546a4b845e56122c846f63e29dc5f948 100644
3733
3755
--- a/src/vs/workbench/api/node/extHostCLIServer.ts
3734
3756
+++ b/src/vs/workbench/api/node/extHostCLIServer.ts
3735
3757
@@ -11,6 +11,8 @@ import { IWindowOpenable, IOpenWindowOptions } from 'vs/platform/windows/common/
@@ -3746,7 +3768,7 @@ index b3857616f7006127c423dcef7020ae4653da5ff6..1c1b80a2767bf77f30ca5bfee715c337
3746
3768
3747
3769
private async setup(): Promise<string> {
3748
3770
+ // NOTE@coder: Write this out so we can get the most recent path.
3749
- + fs.promises.writeFile(join(tmpdir(), " vscode-ipc" ), this._ipcHandlePath).catch((error) => {
3771
+ + fs.promises.writeFile(join(tmpdir(), ' vscode-ipc' ), this._ipcHandlePath).catch((error) => {
3750
3772
+ this.logService.error(error);
3751
3773
+ });
3752
3774
+
@@ -3771,7 +3793,7 @@ index 3843fdec386edc09a1d361b63de892a04e0070ed..8aac4df527857e964798362a69f5591b
3771
3793
registerSingleton(ILogService, ExtHostLogService);
3772
3794
+ registerSingleton(IExtHostNodeProxy, ExtHostNodeProxy);
3773
3795
diff --git a/src/vs/workbench/api/worker/extHostExtensionService.ts b/src/vs/workbench/api/worker/extHostExtensionService.ts
3774
- index 021af6e0f8983c492f9cdd048ba2dcae7640bc1d..814dd0ff2fa7737e07833d8092c8f48953c73c47 100644
3796
+ index 021af6e0f8983c492f9cdd048ba2dcae7640bc1d..4474a93beba03365709c3cda98b682131ad4745f 100644
3775
3797
--- a/src/vs/workbench/api/worker/extHostExtensionService.ts
3776
3798
+++ b/src/vs/workbench/api/worker/extHostExtensionService.ts
3777
3799
@@ -11,6 +11,7 @@ import { RequireInterceptor } from 'vs/workbench/api/common/extHostRequireInterc
@@ -3789,7 +3811,7 @@ index 021af6e0f8983c492f9cdd048ba2dcae7640bc1d..814dd0ff2fa7737e07833d8092c8f489
3789
3811
- return extensionDescription.browser;
3790
3812
+ // NOTE@coder: We can support regular Node modules as well. These will just
3791
3813
+ // require the root of the extension.
3792
- + return extensionDescription.browser || "." ;
3814
+ + return extensionDescription.browser || '.' ;
3793
3815
}
3794
3816
3795
3817
- protected async _loadCommonJSModule<T>(module: URI, activationTimesBuilder: ExtensionActivationTimesBuilder): Promise<T> {
@@ -4028,7 +4050,7 @@ index 85d83f37da179a1e39266cf72a02e971f590308e..0659738b36df1747c9afcabf8d9abf26
4028
4050
};
4029
4051
4030
4052
diff --git a/src/vs/workbench/services/environment/browser/environmentService.ts b/src/vs/workbench/services/environment/browser/environmentService.ts
4031
- index a8d43045ecc8cbe04b3f8440cff16d42aadbcad0..8e122c761ac7ddfee11f9dda2ac5e845b893cc28 100644
4053
+ index a8d43045ecc8cbe04b3f8440cff16d42aadbcad0..d051473515e35b331672b780109bd40229153c8c 100644
4032
4054
--- a/src/vs/workbench/services/environment/browser/environmentService.ts
4033
4055
+++ b/src/vs/workbench/services/environment/browser/environmentService.ts
4034
4056
@@ -119,8 +119,25 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
@@ -4049,9 +4071,9 @@ index a8d43045ecc8cbe04b3f8440cff16d42aadbcad0..8e122c761ac7ddfee11f9dda2ac5e845
4049
4071
+ get userRoamingDataHome(): URI { return joinPath(URI.file(this.userDataPath).with({ scheme: Schemas.vscodeRemote }), 'User'); }
4050
4072
+ @memoize
4051
4073
+ get userDataPath(): string {
4052
- + const dataPath = this.payload?.get(" userDataPath" );
4074
+ + const dataPath = this.payload?.get(' userDataPath' );
4053
4075
+ if (!dataPath) {
4054
- + throw new Error(" userDataPath was not provided to environment service" );
4076
+ + throw new Error(' userDataPath was not provided to environment service' );
4055
4077
+ }
4056
4078
+ return dataPath;
4057
4079
+ }
@@ -4113,9 +4135,18 @@ index de7e301d3f0c67ce662827f61427a5a7b3616b9f..877ea8e11e6e6d34b9a8fe16287af309
4113
4135
}
4114
4136
4115
4137
diff --git a/src/vs/workbench/services/extensions/browser/extensionService.ts b/src/vs/workbench/services/extensions/browser/extensionService.ts
4116
- index 1dff19bf177eff24f722b748b79835a653241c4d..0f59ad290c82cc4c9d09c565c1018cc275ca0249 100644
4138
+ index 1dff19bf177eff24f722b748b79835a653241c4d..01ce9bc00cc39c27e75db006425c359f813a4719 100644
4117
4139
--- a/src/vs/workbench/services/extensions/browser/extensionService.ts
4118
4140
+++ b/src/vs/workbench/services/extensions/browser/extensionService.ts
4141
+ @@ -87,7 +87,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten
4142
+ if (code === ExtensionHostExitCode.StartTimeout10s) {
4143
+ this._notificationService.prompt(
4144
+ Severity.Error,
4145
+ - nls.localize('extensionService.startTimeout', "The Web Worker Extension Host did not start in 10s."),
4146
+ + nls.localize('extensionService.startTimeout', 'The Web Worker Extension Host did not start in 10s.'),
4147
+ []
4148
+ );
4149
+ return;
4119
4150
@@ -177,8 +177,10 @@ export class ExtensionService extends AbstractExtensionService implements IExten
4120
4151
this._remoteAgentService.getEnvironment(),
4121
4152
this._remoteAgentService.scanExtensions()
@@ -4124,10 +4155,19 @@ index 1dff19bf177eff24f722b748b79835a653241c4d..0f59ad290c82cc4c9d09c565c1018cc2
4124
4155
remoteExtensions = this._checkEnabledAndProposedAPI(remoteExtensions);
4125
4156
+ // NOTE@coder: Include remotely hosted extensions that should run locally.
4126
4157
+ localExtensions = this._checkEnabledAndProposedAPI(localExtensions)
4127
- + .concat(remoteExtensions.filter(ext => !ext.browser && ext.extensionKind && (ext.extensionKind === " web" || ext.extensionKind.includes(" web" ))));
4158
+ + .concat(remoteExtensions.filter(ext => !ext.browser && ext.extensionKind && (ext.extensionKind === ' web' || ext.extensionKind.includes(' web' ))));
4128
4159
4129
4160
const remoteAgentConnection = this._remoteAgentService.getConnection();
4130
4161
this._runningLocation = this._runningLocationClassifier.determineRunningLocation(localExtensions, remoteExtensions);
4162
+ @@ -188,7 +190,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten
4163
+
4164
+ const result = this._registry.deltaExtensions(remoteExtensions.concat(localExtensions), []);
4165
+ if (result.removedDueToLooping.length > 0) {
4166
+ - this._logOrShowMessage(Severity.Error, nls.localize('looping', "The following extensions contain dependency loops and have been disabled: {0}", result.removedDueToLooping.map(e => `'${e.identifier.value}'`).join(', ')));
4167
+ + this._logOrShowMessage(Severity.Error, nls.localize('looping', 'The following extensions contain dependency loops and have been disabled: {0}', result.removedDueToLooping.map(e => `'${e.identifier.value}'`).join(', ')));
4168
+ }
4169
+
4170
+ if (remoteEnv && remoteAgentConnection) {
4131
4171
diff --git a/src/vs/workbench/services/extensions/common/extensionsUtil.ts b/src/vs/workbench/services/extensions/common/extensionsUtil.ts
4132
4172
index 65e532ee58dfc06ed944846d01b885cb8f260ebc..0b6282fde7ad03c7ea9872a777cbf487253abed1 100644
4133
4173
--- a/src/vs/workbench/services/extensions/common/extensionsUtil.ts
0 commit comments