@codingame/monaco-vscode-remote-agent-service-override 3.2.3 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/package.json +3 -3
  2. package/remoteAgent.js +9 -9
  3. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  4. package/override/vs/platform/dialogs/common/dialogs.js +0 -8
  5. package/vscode/src/vs/platform/download/common/downloadIpc.js +0 -18
  6. package/vscode/src/vs/platform/log/common/logIpc.js +0 -26
  7. package/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.js +0 -110
  8. package/vscode/src/vs/workbench/contrib/remote/browser/explorerViewItems.js +0 -135
  9. package/vscode/src/vs/workbench/contrib/remote/browser/media/remoteViewlet.css.js +0 -6
  10. package/vscode/src/vs/workbench/contrib/remote/browser/remote.contribution.js +0 -19
  11. package/vscode/src/vs/workbench/contrib/remote/browser/remote.js +0 -831
  12. package/vscode/src/vs/workbench/contrib/remote/browser/remoteConnectionHealth.js +0 -158
  13. package/vscode/src/vs/workbench/contrib/remote/browser/remoteIndicator.js +0 -774
  14. package/vscode/src/vs/workbench/contrib/remote/browser/remoteStartEntry.contribution.js +0 -6
  15. package/vscode/src/vs/workbench/contrib/remote/browser/remoteStartEntry.js +0 -97
  16. package/vscode/src/vs/workbench/contrib/remote/browser/showCandidate.js +0 -35
  17. package/vscode/src/vs/workbench/contrib/remote/browser/tunnelFactory.js +0 -110
  18. package/vscode/src/vs/workbench/contrib/remote/common/remote.contribution.js +0 -515
  19. package/vscode/src/vs/workbench/services/remote/browser/browserRemoteResourceHandler.js +0 -49
  20. package/vscode/src/vs/workbench/services/remote/browser/remoteAgentService.js +0 -78
  21. package/vscode/src/vs/workbench/services/remote/common/abstractRemoteAgentService.js +0 -179
  22. package/vscode/src/vs/workbench/services/remote/common/remoteAgentEnvironmentChannel.js +0 -54
  23. package/vscode/src/vs/workbench/services/remote/common/remoteExtensionsScanner.js +0 -73
  24. package/vscode/src/vs/workbench/services/tunnel/browser/tunnelService.js +0 -36
@@ -1,515 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { Extensions, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
3
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
4
- import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
5
- import { OS, isWeb } from 'vscode/vscode/vs/base/common/platform';
6
- import { Schemas } from 'vscode/vscode/vs/base/common/network';
7
- import { IRemoteAgentService } from 'vscode/vscode/vs/workbench/services/remote/common/remoteAgentService';
8
- import { ILoggerService } from 'vscode/vscode/vs/platform/log/common/log';
9
- import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
10
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
11
- import { Extensions as Extensions$1 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
12
- import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
13
- import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
14
- import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
15
- import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
16
- import { firstOrDefault } from 'vscode/vscode/vs/base/common/arrays';
17
- import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
18
- import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
19
- import { PersistentConnection } from 'vscode/vscode/vs/platform/remote/common/remoteAgentConnection';
20
- import { IDownloadService } from 'vscode/vscode/vs/platform/download/common/download';
21
- import { DownloadServiceChannel } from '../../../../platform/download/common/downloadIpc.js';
22
- import { RemoteLoggerChannelClient } from '../../../../platform/log/common/logIpc.js';
23
- import { IDialogService, IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
24
-
25
- let LabelContribution = class LabelContribution {
26
- static { this.ID = 'workbench.contrib.remoteLabel'; }
27
- constructor(labelService, remoteAgentService) {
28
- this.labelService = labelService;
29
- this.remoteAgentService = remoteAgentService;
30
- this.registerFormatters();
31
- }
32
- registerFormatters() {
33
- this.remoteAgentService.getEnvironment().then(remoteEnvironment => {
34
- const os = remoteEnvironment?.os || OS;
35
- const formatting = {
36
- label: '${path}',
37
- separator: os === 1 ? '\\' : '/',
38
- tildify: os !== 1 ,
39
- normalizeDriveLetter: os === 1 ,
40
- workspaceSuffix: isWeb ? undefined : Schemas.vscodeRemote
41
- };
42
- this.labelService.registerFormatter({
43
- scheme: Schemas.vscodeRemote,
44
- formatting
45
- });
46
- if (remoteEnvironment) {
47
- this.labelService.registerFormatter({
48
- scheme: Schemas.vscodeUserData,
49
- formatting
50
- });
51
- }
52
- });
53
- }
54
- };
55
- LabelContribution = ( __decorate([
56
- ( __param(0, ILabelService)),
57
- ( __param(1, IRemoteAgentService))
58
- ], LabelContribution));
59
- let RemoteChannelsContribution = class RemoteChannelsContribution extends Disposable {
60
- constructor(remoteAgentService, downloadService, loggerService) {
61
- super();
62
- const connection = remoteAgentService.getConnection();
63
- if (connection) {
64
- connection.registerChannel('download', ( new DownloadServiceChannel(downloadService)));
65
- connection.withChannel('logger', async (channel) => this._register(( new RemoteLoggerChannelClient(loggerService, channel))));
66
- }
67
- }
68
- };
69
- RemoteChannelsContribution = ( __decorate([
70
- ( __param(0, IRemoteAgentService)),
71
- ( __param(1, IDownloadService)),
72
- ( __param(2, ILoggerService))
73
- ], RemoteChannelsContribution));
74
- let RemoteInvalidWorkspaceDetector = class RemoteInvalidWorkspaceDetector extends Disposable {
75
- static { this.ID = 'workbench.contrib.remoteInvalidWorkspaceDetector'; }
76
- constructor(fileService, dialogService, environmentService, contextService, fileDialogService, remoteAgentService) {
77
- super();
78
- this.fileService = fileService;
79
- this.dialogService = dialogService;
80
- this.environmentService = environmentService;
81
- this.contextService = contextService;
82
- this.fileDialogService = fileDialogService;
83
- if (this.environmentService.remoteAuthority) {
84
- remoteAgentService.getEnvironment().then(remoteEnv => {
85
- if (remoteEnv) {
86
- this.validateRemoteWorkspace();
87
- }
88
- });
89
- }
90
- }
91
- async validateRemoteWorkspace() {
92
- const workspace = this.contextService.getWorkspace();
93
- const workspaceUriToStat = workspace.configuration ?? firstOrDefault(workspace.folders)?.uri;
94
- if (!workspaceUriToStat) {
95
- return;
96
- }
97
- const exists = await this.fileService.exists(workspaceUriToStat);
98
- if (exists) {
99
- return;
100
- }
101
- const res = await this.dialogService.confirm({
102
- type: 'warning',
103
- message: ( localizeWithPath(
104
- 'vs/workbench/contrib/remote/common/remote.contribution',
105
- 'invalidWorkspaceMessage',
106
- "Workspace does not exist"
107
- )),
108
- detail: ( localizeWithPath(
109
- 'vs/workbench/contrib/remote/common/remote.contribution',
110
- 'invalidWorkspaceDetail',
111
- "Please select another workspace to open."
112
- )),
113
- primaryButton: ( localizeWithPath(
114
- 'vs/workbench/contrib/remote/common/remote.contribution',
115
- { key: 'invalidWorkspacePrimary', comment: ['&& denotes a mnemonic'] },
116
- "&&Open Workspace..."
117
- ))
118
- });
119
- if (res.confirmed) {
120
- if (workspace.configuration) {
121
- return this.fileDialogService.pickWorkspaceAndOpen({});
122
- }
123
- return this.fileDialogService.pickFolderAndOpen({});
124
- }
125
- }
126
- };
127
- RemoteInvalidWorkspaceDetector = ( __decorate([
128
- ( __param(0, IFileService)),
129
- ( __param(1, IDialogService)),
130
- ( __param(2, IWorkbenchEnvironmentService)),
131
- ( __param(3, IWorkspaceContextService)),
132
- ( __param(4, IFileDialogService)),
133
- ( __param(5, IRemoteAgentService))
134
- ], RemoteInvalidWorkspaceDetector));
135
- const workbenchContributionsRegistry = ( Registry.as(Extensions.Workbench));
136
- registerWorkbenchContribution2(LabelContribution.ID, LabelContribution, 1 );
137
- workbenchContributionsRegistry.registerWorkbenchContribution(RemoteChannelsContribution, 3 );
138
- registerWorkbenchContribution2(RemoteInvalidWorkspaceDetector.ID, RemoteInvalidWorkspaceDetector, 1 );
139
- {
140
- class TriggerReconnectAction extends Action2 {
141
- constructor() {
142
- super({
143
- id: 'workbench.action.triggerReconnect',
144
- title: ( localize2WithPath(
145
- 'vs/workbench/contrib/remote/common/remote.contribution',
146
- 'triggerReconnect',
147
- 'Connection: Trigger Reconnect'
148
- )),
149
- category: Categories.Developer,
150
- f1: true,
151
- });
152
- }
153
- async run(accessor) {
154
- PersistentConnection.debugTriggerReconnection();
155
- }
156
- }
157
- class PauseSocketWriting extends Action2 {
158
- constructor() {
159
- super({
160
- id: 'workbench.action.pauseSocketWriting',
161
- title: ( localize2WithPath(
162
- 'vs/workbench/contrib/remote/common/remote.contribution',
163
- 'pauseSocketWriting',
164
- 'Connection: Pause socket writing'
165
- )),
166
- category: Categories.Developer,
167
- f1: true,
168
- });
169
- }
170
- async run(accessor) {
171
- PersistentConnection.debugPauseSocketWriting();
172
- }
173
- }
174
- registerAction2(TriggerReconnectAction);
175
- registerAction2(PauseSocketWriting);
176
- }
177
- const extensionKindSchema = {
178
- type: 'string',
179
- enum: [
180
- 'ui',
181
- 'workspace'
182
- ],
183
- enumDescriptions: [
184
- ( localizeWithPath(
185
- 'vs/workbench/contrib/remote/common/remote.contribution',
186
- 'ui',
187
- "UI extension kind. In a remote window, such extensions are enabled only when available on the local machine."
188
- )),
189
- ( localizeWithPath(
190
- 'vs/workbench/contrib/remote/common/remote.contribution',
191
- 'workspace',
192
- "Workspace extension kind. In a remote window, such extensions are enabled only when available on the remote."
193
- ))
194
- ],
195
- };
196
- ( Registry.as(Extensions$1.Configuration))
197
- .registerConfiguration({
198
- id: 'remote',
199
- title: ( localizeWithPath(
200
- 'vs/workbench/contrib/remote/common/remote.contribution',
201
- 'remote',
202
- "Remote"
203
- )),
204
- type: 'object',
205
- properties: {
206
- 'remote.extensionKind': {
207
- type: 'object',
208
- markdownDescription: ( localizeWithPath(
209
- 'vs/workbench/contrib/remote/common/remote.contribution',
210
- 'remote.extensionKind',
211
- "Override the kind of an extension. `ui` extensions are installed and run on the local machine while `workspace` extensions are run on the remote. By overriding an extension's default kind using this setting, you specify if that extension should be installed and enabled locally or remotely."
212
- )),
213
- patternProperties: {
214
- '([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$': {
215
- oneOf: [{ type: 'array', items: extensionKindSchema }, extensionKindSchema],
216
- default: ['ui'],
217
- },
218
- },
219
- default: {
220
- 'pub.name': ['ui']
221
- }
222
- },
223
- 'remote.restoreForwardedPorts': {
224
- type: 'boolean',
225
- markdownDescription: ( localizeWithPath(
226
- 'vs/workbench/contrib/remote/common/remote.contribution',
227
- 'remote.restoreForwardedPorts',
228
- "Restores the ports you forwarded in a workspace."
229
- )),
230
- default: true
231
- },
232
- 'remote.autoForwardPorts': {
233
- type: 'boolean',
234
- markdownDescription: ( localizeWithPath(
235
- 'vs/workbench/contrib/remote/common/remote.contribution',
236
- 'remote.autoForwardPorts',
237
- "When enabled, new running processes are detected and ports that they listen on are automatically forwarded. Disabling this setting will not prevent all ports from being forwarded. Even when disabled, extensions will still be able to cause ports to be forwarded, and opening some URLs will still cause ports to forwarded."
238
- )),
239
- default: true
240
- },
241
- 'remote.autoForwardPortsSource': {
242
- type: 'string',
243
- markdownDescription: ( localizeWithPath(
244
- 'vs/workbench/contrib/remote/common/remote.contribution',
245
- 'remote.autoForwardPortsSource',
246
- "Sets the source from which ports are automatically forwarded when {0} is true. On Windows and macOS remotes, the `process` and `hybrid` options have no effect and `output` will be used.",
247
- '`#remote.autoForwardPorts#`'
248
- )),
249
- enum: ['process', 'output', 'hybrid'],
250
- enumDescriptions: [
251
- ( localizeWithPath(
252
- 'vs/workbench/contrib/remote/common/remote.contribution',
253
- 'remote.autoForwardPortsSource.process',
254
- "Ports will be automatically forwarded when discovered by watching for processes that are started and include a port."
255
- )),
256
- ( localizeWithPath(
257
- 'vs/workbench/contrib/remote/common/remote.contribution',
258
- 'remote.autoForwardPortsSource.output',
259
- "Ports will be automatically forwarded when discovered by reading terminal and debug output. Not all processes that use ports will print to the integrated terminal or debug console, so some ports will be missed. Ports forwarded based on output will not be \"un-forwarded\" until reload or until the port is closed by the user in the Ports view."
260
- )),
261
- ( localizeWithPath(
262
- 'vs/workbench/contrib/remote/common/remote.contribution',
263
- 'remote.autoForwardPortsSource.hybrid',
264
- "Ports will be automatically forwarded when discovered by reading terminal and debug output. Not all processes that use ports will print to the integrated terminal or debug console, so some ports will be missed. Ports will be \"un-forwarded\" by watching for processes that listen on that port to be terminated."
265
- ))
266
- ],
267
- default: 'process'
268
- },
269
- 'remote.autoForwardPortsFallback': {
270
- type: 'number',
271
- default: 20,
272
- markdownDescription: ( localizeWithPath(
273
- 'vs/workbench/contrib/remote/common/remote.contribution',
274
- 'remote.autoForwardPortFallback',
275
- "The number of auto forwarded ports that will trigger the switch from `process` to `hybrid` when automatically forwarding ports and `remote.autoForwardPortsSource` is set to `process`. Set to `0` to disable the fallback."
276
- ))
277
- },
278
- 'remote.forwardOnOpen': {
279
- type: 'boolean',
280
- description: ( localizeWithPath(
281
- 'vs/workbench/contrib/remote/common/remote.contribution',
282
- 'remote.forwardOnClick',
283
- "Controls whether local URLs with a port will be forwarded when opened from the terminal and the debug console."
284
- )),
285
- default: true
286
- },
287
- 'remote.portsAttributes': {
288
- type: 'object',
289
- patternProperties: {
290
- '(^\\d+(-\\d+)?$)|(.+)': {
291
- type: 'object',
292
- description: ( localizeWithPath(
293
- 'vs/workbench/contrib/remote/common/remote.contribution',
294
- 'remote.portsAttributes.port',
295
- "A port, range of ports (ex. \"40000-55000\"), host and port (ex. \"db:1234\"), or regular expression (ex. \".+\\\\/server.js\"). For a port number or range, the attributes will apply to that port number or range of port numbers. Attributes which use a regular expression will apply to ports whose associated process command line matches the expression."
296
- )),
297
- properties: {
298
- 'onAutoForward': {
299
- type: 'string',
300
- enum: ['notify', 'openBrowser', 'openBrowserOnce', 'openPreview', 'silent', 'ignore'],
301
- enumDescriptions: [
302
- ( localizeWithPath(
303
- 'vs/workbench/contrib/remote/common/remote.contribution',
304
- 'remote.portsAttributes.notify',
305
- "Shows a notification when a port is automatically forwarded."
306
- )),
307
- ( localizeWithPath(
308
- 'vs/workbench/contrib/remote/common/remote.contribution',
309
- 'remote.portsAttributes.openBrowser',
310
- "Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser."
311
- )),
312
- ( localizeWithPath(
313
- 'vs/workbench/contrib/remote/common/remote.contribution',
314
- 'remote.portsAttributes.openBrowserOnce',
315
- "Opens the browser when the port is automatically forwarded, but only the first time the port is forward during a session. Depending on your settings, this could open an embedded browser."
316
- )),
317
- ( localizeWithPath(
318
- 'vs/workbench/contrib/remote/common/remote.contribution',
319
- 'remote.portsAttributes.openPreview',
320
- "Opens a preview in the same window when the port is automatically forwarded."
321
- )),
322
- ( localizeWithPath(
323
- 'vs/workbench/contrib/remote/common/remote.contribution',
324
- 'remote.portsAttributes.silent',
325
- "Shows no notification and takes no action when this port is automatically forwarded."
326
- )),
327
- ( localizeWithPath(
328
- 'vs/workbench/contrib/remote/common/remote.contribution',
329
- 'remote.portsAttributes.ignore',
330
- "This port will not be automatically forwarded."
331
- ))
332
- ],
333
- description: ( localizeWithPath(
334
- 'vs/workbench/contrib/remote/common/remote.contribution',
335
- 'remote.portsAttributes.onForward',
336
- "Defines the action that occurs when the port is discovered for automatic forwarding"
337
- )),
338
- default: 'notify'
339
- },
340
- 'elevateIfNeeded': {
341
- type: 'boolean',
342
- description: ( localizeWithPath(
343
- 'vs/workbench/contrib/remote/common/remote.contribution',
344
- 'remote.portsAttributes.elevateIfNeeded',
345
- "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port."
346
- )),
347
- default: false
348
- },
349
- 'label': {
350
- type: 'string',
351
- description: ( localizeWithPath(
352
- 'vs/workbench/contrib/remote/common/remote.contribution',
353
- 'remote.portsAttributes.label',
354
- "Label that will be shown in the UI for this port."
355
- )),
356
- default: ( localizeWithPath(
357
- 'vs/workbench/contrib/remote/common/remote.contribution',
358
- 'remote.portsAttributes.labelDefault',
359
- "Application"
360
- ))
361
- },
362
- 'requireLocalPort': {
363
- type: 'boolean',
364
- markdownDescription: ( localizeWithPath(
365
- 'vs/workbench/contrib/remote/common/remote.contribution',
366
- 'remote.portsAttributes.requireLocalPort',
367
- "When true, a modal dialog will show if the chosen local port isn't used for forwarding."
368
- )),
369
- default: false
370
- },
371
- 'protocol': {
372
- type: 'string',
373
- enum: ['http', 'https'],
374
- description: ( localizeWithPath(
375
- 'vs/workbench/contrib/remote/common/remote.contribution',
376
- 'remote.portsAttributes.protocol',
377
- "The protocol to use when forwarding this port."
378
- ))
379
- }
380
- },
381
- default: {
382
- 'label': ( localizeWithPath(
383
- 'vs/workbench/contrib/remote/common/remote.contribution',
384
- 'remote.portsAttributes.labelDefault',
385
- "Application"
386
- )),
387
- 'onAutoForward': 'notify'
388
- }
389
- }
390
- },
391
- markdownDescription: ( localizeWithPath(
392
- 'vs/workbench/contrib/remote/common/remote.contribution',
393
- 'remote.portsAttributes',
394
- "Set properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Application\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n},\n\".+\\\\/server.js\": {\n \"onAutoForward\": \"openPreview\"\n}\n```"
395
- )),
396
- defaultSnippets: [{ body: { '${1:3000}': { label: '${2:Application}', onAutoForward: 'openPreview' } } }],
397
- errorMessage: ( localizeWithPath(
398
- 'vs/workbench/contrib/remote/common/remote.contribution',
399
- 'remote.portsAttributes.patternError',
400
- "Must be a port number, range of port numbers, or regular expression."
401
- )),
402
- additionalProperties: false,
403
- default: {
404
- '443': {
405
- 'protocol': 'https'
406
- },
407
- '8443': {
408
- 'protocol': 'https'
409
- }
410
- }
411
- },
412
- 'remote.otherPortsAttributes': {
413
- type: 'object',
414
- properties: {
415
- 'onAutoForward': {
416
- type: 'string',
417
- enum: ['notify', 'openBrowser', 'openPreview', 'silent', 'ignore'],
418
- enumDescriptions: [
419
- ( localizeWithPath(
420
- 'vs/workbench/contrib/remote/common/remote.contribution',
421
- 'remote.portsAttributes.notify',
422
- "Shows a notification when a port is automatically forwarded."
423
- )),
424
- ( localizeWithPath(
425
- 'vs/workbench/contrib/remote/common/remote.contribution',
426
- 'remote.portsAttributes.openBrowser',
427
- "Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser."
428
- )),
429
- ( localizeWithPath(
430
- 'vs/workbench/contrib/remote/common/remote.contribution',
431
- 'remote.portsAttributes.openPreview',
432
- "Opens a preview in the same window when the port is automatically forwarded."
433
- )),
434
- ( localizeWithPath(
435
- 'vs/workbench/contrib/remote/common/remote.contribution',
436
- 'remote.portsAttributes.silent',
437
- "Shows no notification and takes no action when this port is automatically forwarded."
438
- )),
439
- ( localizeWithPath(
440
- 'vs/workbench/contrib/remote/common/remote.contribution',
441
- 'remote.portsAttributes.ignore',
442
- "This port will not be automatically forwarded."
443
- ))
444
- ],
445
- description: ( localizeWithPath(
446
- 'vs/workbench/contrib/remote/common/remote.contribution',
447
- 'remote.portsAttributes.onForward',
448
- "Defines the action that occurs when the port is discovered for automatic forwarding"
449
- )),
450
- default: 'notify'
451
- },
452
- 'elevateIfNeeded': {
453
- type: 'boolean',
454
- description: ( localizeWithPath(
455
- 'vs/workbench/contrib/remote/common/remote.contribution',
456
- 'remote.portsAttributes.elevateIfNeeded',
457
- "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port."
458
- )),
459
- default: false
460
- },
461
- 'label': {
462
- type: 'string',
463
- description: ( localizeWithPath(
464
- 'vs/workbench/contrib/remote/common/remote.contribution',
465
- 'remote.portsAttributes.label',
466
- "Label that will be shown in the UI for this port."
467
- )),
468
- default: ( localizeWithPath(
469
- 'vs/workbench/contrib/remote/common/remote.contribution',
470
- 'remote.portsAttributes.labelDefault',
471
- "Application"
472
- ))
473
- },
474
- 'requireLocalPort': {
475
- type: 'boolean',
476
- markdownDescription: ( localizeWithPath(
477
- 'vs/workbench/contrib/remote/common/remote.contribution',
478
- 'remote.portsAttributes.requireLocalPort',
479
- "When true, a modal dialog will show if the chosen local port isn't used for forwarding."
480
- )),
481
- default: false
482
- },
483
- 'protocol': {
484
- type: 'string',
485
- enum: ['http', 'https'],
486
- description: ( localizeWithPath(
487
- 'vs/workbench/contrib/remote/common/remote.contribution',
488
- 'remote.portsAttributes.protocol',
489
- "The protocol to use when forwarding this port."
490
- ))
491
- }
492
- },
493
- defaultSnippets: [{ body: { onAutoForward: 'ignore' } }],
494
- markdownDescription: ( localizeWithPath(
495
- 'vs/workbench/contrib/remote/common/remote.contribution',
496
- 'remote.portsAttributes.defaults',
497
- "Set default properties that are applied to all ports that don't get properties from the setting {0}. For example:\n\n```\n{\n \"onAutoForward\": \"ignore\"\n}\n```",
498
- '`#remote.portsAttributes#`'
499
- )),
500
- additionalProperties: false
501
- },
502
- 'remote.localPortHost': {
503
- type: 'string',
504
- enum: ['localhost', 'allInterfaces'],
505
- default: 'localhost',
506
- description: ( localizeWithPath(
507
- 'vs/workbench/contrib/remote/common/remote.contribution',
508
- 'remote.localPortHost',
509
- "Specifies the local host name that will be used for port forwarding."
510
- ))
511
- }
512
- }
513
- });
514
-
515
- export { LabelContribution };
@@ -1,49 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
3
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
- import { getMediaOrTextMime } from 'vscode/vscode/vs/base/common/mime';
5
- import { URI } from 'vscode/vscode/vs/base/common/uri';
6
- import { FileOperationError, IFileService } from 'vscode/vscode/vs/platform/files/common/files';
7
-
8
- let BrowserRemoteResourceLoader = class BrowserRemoteResourceLoader extends Disposable {
9
- constructor(fileService, provider) {
10
- super();
11
- this.provider = provider;
12
- this._register(provider.onDidReceiveRequest(async (request) => {
13
- let uri;
14
- try {
15
- uri = JSON.parse(decodeURIComponent(request.uri.query));
16
- }
17
- catch {
18
- return request.respondWith(404, ( new Uint8Array()), {});
19
- }
20
- let content;
21
- try {
22
- content = await fileService.readFile(( URI.from(uri, true)));
23
- }
24
- catch (e) {
25
- const str = VSBuffer.fromString(e.message).buffer;
26
- if (e instanceof FileOperationError && e.fileOperationResult === 1 ) {
27
- return request.respondWith(404, str, {});
28
- }
29
- else {
30
- return request.respondWith(500, str, {});
31
- }
32
- }
33
- const mime = uri.path && getMediaOrTextMime(uri.path);
34
- request.respondWith(200, content.value.buffer, mime ? { 'content-type': mime } : {});
35
- }));
36
- }
37
- getResourceUriProvider() {
38
- const baseUri = ( URI.parse(document.location.href));
39
- return uri => baseUri.with({
40
- path: this.provider.path,
41
- query: JSON.stringify(uri),
42
- });
43
- }
44
- };
45
- BrowserRemoteResourceLoader = ( __decorate([
46
- ( __param(0, IFileService))
47
- ], BrowserRemoteResourceLoader));
48
-
49
- export { BrowserRemoteResourceLoader };
@@ -1,78 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
4
- import { IRemoteAgentService } from 'vscode/vscode/vs/workbench/services/remote/common/remoteAgentService';
5
- import { RemoteAuthorityResolverError, IRemoteAuthorityResolverService } from 'vscode/vscode/vs/platform/remote/common/remoteAuthorityResolver';
6
- import { AbstractRemoteAgentService } from '../common/abstractRemoteAgentService.js';
7
- import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
8
- import { ISignService } from 'vscode/vscode/vs/platform/sign/common/sign';
9
- import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
10
- import { Severity } from 'vscode/vscode/vs/platform/notification/common/notification';
11
- import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
12
- import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
13
- import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
14
- import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
15
- import { IRemoteSocketFactoryService } from 'vscode/vscode/vs/platform/remote/common/remoteSocketFactoryService';
16
- import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
17
-
18
- let RemoteAgentService = class RemoteAgentService extends AbstractRemoteAgentService {
19
- constructor(remoteSocketFactoryService, userDataProfileService, environmentService, productService, remoteAuthorityResolverService, signService, logService) {
20
- super(remoteSocketFactoryService, userDataProfileService, environmentService, productService, remoteAuthorityResolverService, signService, logService);
21
- }
22
- };
23
- RemoteAgentService = ( __decorate([
24
- ( __param(0, IRemoteSocketFactoryService)),
25
- ( __param(1, IUserDataProfileService)),
26
- ( __param(2, IWorkbenchEnvironmentService)),
27
- ( __param(3, IProductService)),
28
- ( __param(4, IRemoteAuthorityResolverService)),
29
- ( __param(5, ISignService)),
30
- ( __param(6, ILogService))
31
- ], RemoteAgentService));
32
- let RemoteConnectionFailureNotificationContribution = class RemoteConnectionFailureNotificationContribution {
33
- static { this.ID = 'workbench.contrib.browserRemoteConnectionFailureNotification'; }
34
- constructor(remoteAgentService, _dialogService, _hostService) {
35
- this._dialogService = _dialogService;
36
- this._hostService = _hostService;
37
- remoteAgentService.getRawEnvironment()
38
- .then(undefined, (err) => {
39
- if (!RemoteAuthorityResolverError.isHandled(err)) {
40
- this._presentConnectionError(err);
41
- }
42
- });
43
- }
44
- async _presentConnectionError(err) {
45
- await this._dialogService.prompt({
46
- type: Severity.Error,
47
- message: ( localizeWithPath(
48
- 'vs/workbench/services/remote/browser/remoteAgentService',
49
- 'connectionError',
50
- "An unexpected error occurred that requires a reload of this page."
51
- )),
52
- detail: ( localizeWithPath(
53
- 'vs/workbench/services/remote/browser/remoteAgentService',
54
- 'connectionErrorDetail',
55
- "The workbench failed to connect to the server (Error: {0})",
56
- err ? err.message : ''
57
- )),
58
- buttons: [
59
- {
60
- label: ( localizeWithPath(
61
- 'vs/workbench/services/remote/browser/remoteAgentService',
62
- { key: 'reload', comment: ['&& denotes a mnemonic'] },
63
- "&&Reload"
64
- )),
65
- run: () => this._hostService.reload()
66
- }
67
- ]
68
- });
69
- }
70
- };
71
- RemoteConnectionFailureNotificationContribution = ( __decorate([
72
- ( __param(0, IRemoteAgentService)),
73
- ( __param(1, IDialogService)),
74
- ( __param(2, IHostService))
75
- ], RemoteConnectionFailureNotificationContribution));
76
- registerWorkbenchContribution2(RemoteConnectionFailureNotificationContribution.ID, RemoteConnectionFailureNotificationContribution, 2 );
77
-
78
- export { RemoteAgentService };