@codingame/monaco-vscode-remote-agent-service-override 3.2.3 → 4.0.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.
@@ -1,3 +1,5 @@
1
+ export { AbstractDialogHandler, IDialogService, IFileDialogService, getFileNamesMessage } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
2
+
1
3
  var ConfirmResult;
2
4
  ( (function(ConfirmResult) {
3
5
  ConfirmResult[ConfirmResult["SAVE"] = 0] = "SAVE";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-remote-agent-service-override",
3
- "version": "3.2.3",
3
+ "version": "4.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,7 +18,7 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@3.2.3",
22
- "@codingame/monaco-vscode-environment-service-override": "3.2.3"
21
+ "vscode": "npm:@codingame/monaco-vscode-api@4.0.0",
22
+ "@codingame/monaco-vscode-environment-service-override": "4.0.0"
23
23
  }
24
24
  }
package/remoteAgent.js CHANGED
@@ -45,7 +45,7 @@ let InjectedRemoteAuthorityResolverService = class InjectedRemoteAuthorityResolv
45
45
  const connectionToken = environmentService.options.connectionToken;
46
46
  const remoteResourceLoader = configuration.remoteResourceProvider != null ? new BrowserRemoteResourceLoader(fileService, configuration.remoteResourceProvider) : undefined;
47
47
  const resourceUriProvider = configuration.resourceUriProvider ?? remoteResourceLoader?.getResourceUriProvider();
48
- super(!environmentService.expectsResolverExtension, connectionToken, resourceUriProvider, productService, logService);
48
+ super(!environmentService.expectsResolverExtension, connectionToken, resourceUriProvider, configuration.serverBasePath, productService, logService);
49
49
  }
50
50
  };
51
51
  InjectedRemoteAuthorityResolverService = __decorate([
@@ -1,4 +1,6 @@
1
1
  import { URI } from 'vscode/vscode/vs/base/common/uri';
2
+ import 'vscode/vscode/vs/base/common/event';
3
+ import 'vscode/vscode/vs/platform/log/common/log';
2
4
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
3
5
 
4
6
  class RemoteLoggerChannelClient extends Disposable {
@@ -10,10 +10,10 @@ import { StopWatch } from 'vscode/vscode/vs/base/common/stopwatch';
10
10
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
11
11
  import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
12
12
  import { getRemoteAuthorityPrefix, WebSocketRemoteConnection } from 'vscode/vscode/vs/platform/remote/common/remoteAuthorityResolver';
13
- import { getRemoteServerRootPath, parseAuthorityWithOptionalPort } from 'vscode/vscode/vs/platform/remote/common/remoteHosts';
13
+ import { parseAuthorityWithOptionalPort } from 'vscode/vscode/vs/platform/remote/common/remoteHosts';
14
14
 
15
15
  let RemoteAuthorityResolverService = class RemoteAuthorityResolverService extends Disposable {
16
- constructor(isWorkbenchOptionsBasedResolution, connectionToken, resourceUriProvider, productService, _logService) {
16
+ constructor(isWorkbenchOptionsBasedResolution, connectionToken, resourceUriProvider, serverBasePath, productService, _logService) {
17
17
  super();
18
18
  this._logService = _logService;
19
19
  this._onDidChangeConnectionData = this._register(( new Emitter()));
@@ -26,7 +26,7 @@ let RemoteAuthorityResolverService = class RemoteAuthorityResolverService extend
26
26
  if (resourceUriProvider) {
27
27
  RemoteAuthorities.setDelegate(resourceUriProvider);
28
28
  }
29
- RemoteAuthorities.setServerRootPath(getRemoteServerRootPath(productService));
29
+ RemoteAuthorities.setServerRootPath(productService, serverBasePath);
30
30
  }
31
31
  async resolveAuthority(authority) {
32
32
  let result = this._resolveAuthorityRequests.get(authority);
@@ -103,8 +103,8 @@ let RemoteAuthorityResolverService = class RemoteAuthorityResolverService extend
103
103
  }
104
104
  };
105
105
  RemoteAuthorityResolverService = ( __decorate([
106
- ( __param(3, IProductService)),
107
- ( __param(4, ILogService))
106
+ ( __param(4, IProductService)),
107
+ ( __param(5, ILogService))
108
108
  ], RemoteAuthorityResolverService));
109
109
 
110
110
  export { RemoteAuthorityResolverService };
@@ -24,7 +24,7 @@ import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/comma
24
24
  import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress';
25
25
  import { IRemoteAgentService } from 'vscode/vscode/vs/workbench/services/remote/common/remoteAgentService';
26
26
  import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
27
- import Severity from 'vscode/vscode/vs/base/common/severity';
27
+ import Severity$1 from 'vscode/vscode/vs/base/common/severity';
28
28
  import { ReloadWindowAction } from 'vscode/vscode/vs/workbench/browser/actions/windowActions';
29
29
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
30
30
  import { SwitchRemoteViewItem } from './explorerViewItems.js';
@@ -782,7 +782,7 @@ let RemoteAgentConnectionStatusListener = class RemoteAgentConnectionStatusListe
782
782
  else if (!this._reloadWindowShown) {
783
783
  this._reloadWindowShown = true;
784
784
  dialogService.confirm({
785
- type: Severity.Error,
785
+ type: Severity$1.Error,
786
786
  message: ( localizeWithPath(
787
787
  'vs/workbench/contrib/remote/browser/remote',
788
788
  'reconnectionPermanentFailure',
@@ -12,10 +12,11 @@ import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storag
12
12
  import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
13
13
  import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
14
14
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
15
- import Severity from 'vscode/vscode/vs/base/common/severity';
15
+ import Severity$1 from 'vscode/vscode/vs/base/common/severity';
16
16
  import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
17
17
 
18
18
  const REMOTE_UNSUPPORTED_CONNECTION_CHOICE_KEY = 'remote.unsupportedConnectionChoice';
19
+ const BANNER_REMOTE_UNSUPPORTED_CONNECTION_DISMISSED_KEY = 'workbench.banner.remote.unsupportedConnection.dismissed';
19
20
  let InitialRemoteConnectionHealthContribution = class InitialRemoteConnectionHealthContribution {
20
21
  constructor(_remoteAgentService, _environmentService, _telemetryService, bannerService, dialogService, openerService, hostService, storageService, productService) {
21
22
  this._remoteAgentService = _remoteAgentService;
@@ -33,7 +34,7 @@ let InitialRemoteConnectionHealthContribution = class InitialRemoteConnectionHea
33
34
  }
34
35
  async _confirmConnection() {
35
36
  const { result, checkboxChecked } = await this.dialogService.prompt({
36
- type: Severity.Warning,
37
+ type: Severity$1.Warning,
37
38
  message: ( localizeWithPath(
38
39
  'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
39
40
  'unsupportedGlibcWarning',
@@ -87,28 +88,35 @@ let InitialRemoteConnectionHealthContribution = class InitialRemoteConnectionHea
87
88
  allowed = await this._confirmConnection();
88
89
  }
89
90
  if (allowed) {
90
- const actions = [
91
- {
92
- label: ( localizeWithPath(
91
+ const bannerDismissedVersion = this.storageService.get(`${BANNER_REMOTE_UNSUPPORTED_CONNECTION_DISMISSED_KEY}`, 0 ) ?? '';
92
+ const shouldShowBanner = bannerDismissedVersion.slice(0, bannerDismissedVersion.lastIndexOf('.')) !== this.productService.version.slice(0, this.productService.version.lastIndexOf('.'));
93
+ if (shouldShowBanner) {
94
+ const actions = [
95
+ {
96
+ label: ( localizeWithPath(
97
+ 'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
98
+ 'unsupportedGlibcBannerLearnMore',
99
+ "Learn More"
100
+ )),
101
+ href: 'https://aka.ms/vscode-remote/faq/old-linux'
102
+ }
103
+ ];
104
+ this.bannerService.show({
105
+ id: 'unsupportedGlibcWarning.banner',
106
+ message: ( localizeWithPath(
93
107
  'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
94
- 'unsupportedGlibcBannerLearnMore',
95
- "Learn More"
108
+ 'unsupportedGlibcWarning.banner',
109
+ "You are connected to an OS version that is unsupported by {0}.",
110
+ this.productService.nameLong
96
111
  )),
97
- href: 'https://aka.ms/vscode-remote/faq/old-linux'
98
- }
99
- ];
100
- this.bannerService.show({
101
- id: 'unsupportedGlibcWarning.banner',
102
- message: ( localizeWithPath(
103
- 'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
104
- 'unsupportedGlibcWarning.banner',
105
- "You are connected to an OS version that is unsupported by {0}.",
106
- this.productService.nameLong
107
- )),
108
- actions,
109
- icon: Codicon.warning,
110
- disableCloseAction: true
111
- });
112
+ actions,
113
+ icon: Codicon.warning,
114
+ closeLabel: `Do not show again in v${this.productService.version}`,
115
+ onClose: () => {
116
+ this.storageService.store(`${BANNER_REMOTE_UNSUPPORTED_CONNECTION_DISMISSED_KEY}`, this.productService.version, 0 , 1 );
117
+ }
118
+ });
119
+ }
112
120
  }
113
121
  else {
114
122
  this.hostService.openWindow({ forceReuseWindow: true, remoteAuthority: null });
@@ -38,6 +38,10 @@ import { infoIcon } from 'vscode/vscode/vs/workbench/contrib/extensions/browser/
38
38
  import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
39
39
  import { URI } from 'vscode/vscode/vs/base/common/uri';
40
40
  import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
41
+ import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
42
+ import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
43
+ import { workbenchConfigurationNodeBase } from 'vscode/vscode/vs/workbench/common/configuration';
44
+ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
41
45
 
42
46
  var RemoteStatusIndicator_1;
43
47
  let RemoteStatusIndicator = class RemoteStatusIndicator extends Disposable {
@@ -50,7 +54,28 @@ let RemoteStatusIndicator = class RemoteStatusIndicator extends Disposable {
50
54
  static { this.REMOTE_STATUS_LABEL_MAX_LENGTH = 40; }
51
55
  static { this.REMOTE_CONNECTION_LATENCY_SCHEDULER_DELAY = 60 * 1000; }
52
56
  static { this.REMOTE_CONNECTION_LATENCY_SCHEDULER_FIRST_RUN_DELAY = 10 * 1000; }
53
- constructor(statusbarService, environmentService, labelService, contextKeyService, menuService, quickInputService, commandService, extensionService, remoteAgentService, remoteAuthorityResolverService, hostService, workspaceContextService, logService, extensionGalleryService, telemetryService, productService, extensionManagementService, openerService) {
57
+ get remoteExtensionMetadata() {
58
+ if (!this._remoteExtensionMetadata) {
59
+ const remoteExtensionTips = { ...this.productService.remoteExtensionTips, ...this.productService.virtualWorkspaceExtensionTips };
60
+ this._remoteExtensionMetadata = ( ( Object.values(remoteExtensionTips)).filter(value => value.startEntry !== undefined).map(value => {
61
+ return {
62
+ id: value.extensionId,
63
+ installed: false,
64
+ friendlyName: value.friendlyName,
65
+ isPlatformCompatible: false,
66
+ dependencies: [],
67
+ helpLink: value.startEntry?.helpLink ?? '',
68
+ startConnectLabel: value.startEntry?.startConnectLabel ?? '',
69
+ startCommand: value.startEntry?.startCommand ?? '',
70
+ priority: value.startEntry?.priority ?? 10,
71
+ supportedPlatforms: value.supportedPlatforms
72
+ };
73
+ }));
74
+ this.remoteExtensionMetadata.sort((ext1, ext2) => ext1.priority - ext2.priority);
75
+ }
76
+ return this._remoteExtensionMetadata;
77
+ }
78
+ constructor(statusbarService, environmentService, labelService, contextKeyService, menuService, quickInputService, commandService, extensionService, remoteAgentService, remoteAuthorityResolverService, hostService, workspaceContextService, logService, extensionGalleryService, telemetryService, productService, extensionManagementService, openerService, configurationService) {
54
79
  super();
55
80
  this.statusbarService = statusbarService;
56
81
  this.environmentService = environmentService;
@@ -70,6 +95,7 @@ let RemoteStatusIndicator = class RemoteStatusIndicator extends Disposable {
70
95
  this.productService = productService;
71
96
  this.extensionManagementService = extensionManagementService;
72
97
  this.openerService = openerService;
98
+ this.configurationService = configurationService;
73
99
  this.legacyIndicatorMenu = this._register(this.menuService.createMenu(MenuId.StatusBarWindowIndicatorMenu, this.contextKeyService));
74
100
  this.remoteIndicatorMenu = this._register(this.menuService.createMenu(MenuId.StatusBarRemoteIndicatorMenu, this.contextKeyService));
75
101
  this.remoteAuthority = this.environmentService.remoteAuthority;
@@ -80,25 +106,10 @@ let RemoteStatusIndicator = class RemoteStatusIndicator extends Disposable {
80
106
  this.networkState = undefined;
81
107
  this.measureNetworkConnectionLatencyScheduler = undefined;
82
108
  this.loggedInvalidGroupNames = Object.create(null);
109
+ this._remoteExtensionMetadata = undefined;
83
110
  this.remoteMetadataInitialized = false;
84
111
  this._onDidChangeEntries = this._register(( new Emitter()));
85
112
  this.onDidChangeEntries = this._onDidChangeEntries.event;
86
- const remoteExtensionTips = { ...this.productService.remoteExtensionTips, ...this.productService.virtualWorkspaceExtensionTips };
87
- this.remoteExtensionMetadata = ( ( Object.values(remoteExtensionTips)).filter(value => value.startEntry !== undefined).map(value => {
88
- return {
89
- id: value.extensionId,
90
- installed: false,
91
- friendlyName: value.friendlyName,
92
- isPlatformCompatible: false,
93
- dependencies: [],
94
- helpLink: value.startEntry?.helpLink ?? '',
95
- startConnectLabel: value.startEntry?.startConnectLabel ?? '',
96
- startCommand: value.startEntry?.startCommand ?? '',
97
- priority: value.startEntry?.priority ?? 10,
98
- supportedPlatforms: value.supportedPlatforms
99
- };
100
- }));
101
- this.remoteExtensionMetadata.sort((ext1, ext2) => ext1.priority - ext2.priority);
102
113
  if (this.remoteAuthority) {
103
114
  this.connectionState = 'initializing';
104
115
  this.connectionStateContextKey.set(this.connectionState);
@@ -118,7 +129,7 @@ let RemoteStatusIndicator = class RemoteStatusIndicator extends Disposable {
118
129
  "Remote"
119
130
  ));
120
131
  const that = this;
121
- registerAction2(class extends Action2 {
132
+ this._register(registerAction2(class extends Action2 {
122
133
  constructor() {
123
134
  super({
124
135
  id: RemoteStatusIndicator_1.REMOTE_ACTIONS_COMMAND_ID,
@@ -136,9 +147,9 @@ let RemoteStatusIndicator = class RemoteStatusIndicator extends Disposable {
136
147
  });
137
148
  this.run = () => that.showRemoteMenu();
138
149
  }
139
- });
150
+ }));
140
151
  if (RemoteStatusIndicator_1.SHOW_CLOSE_REMOTE_COMMAND_ID) {
141
- registerAction2(class extends Action2 {
152
+ this._register(registerAction2(class extends Action2 {
142
153
  constructor() {
143
154
  super({
144
155
  id: RemoteStatusIndicator_1.CLOSE_REMOTE_COMMAND_ID,
@@ -153,7 +164,7 @@ let RemoteStatusIndicator = class RemoteStatusIndicator extends Disposable {
153
164
  });
154
165
  this.run = () => that.hostService.openWindow({ forceReuseWindow: true, remoteAuthority: null });
155
166
  }
156
- });
167
+ }));
157
168
  if (this.remoteAuthority) {
158
169
  MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
159
170
  group: '6_close',
@@ -170,7 +181,7 @@ let RemoteStatusIndicator = class RemoteStatusIndicator extends Disposable {
170
181
  }
171
182
  }
172
183
  if (this.extensionGalleryService.isEnabled()) {
173
- registerAction2(class extends Action2 {
184
+ this._register(registerAction2(class extends Action2 {
174
185
  constructor() {
175
186
  super({
176
187
  id: RemoteStatusIndicator_1.INSTALL_REMOTE_EXTENSIONS_ID,
@@ -192,7 +203,7 @@ let RemoteStatusIndicator = class RemoteStatusIndicator extends Disposable {
192
203
  });
193
204
  };
194
205
  }
195
- });
206
+ }));
196
207
  }
197
208
  }
198
209
  registerListeners() {
@@ -625,7 +636,8 @@ let RemoteStatusIndicator = class RemoteStatusIndicator extends Disposable {
625
636
  }
626
637
  }
627
638
  }
628
- if (this.extensionGalleryService.isEnabled() && this.remoteMetadataInitialized) {
639
+ const showExtensionRecommendations = this.configurationService.getValue('workbench.remoteIndicator.showExtensionRecommendations');
640
+ if (showExtensionRecommendations && this.extensionGalleryService.isEnabled() && this.remoteMetadataInitialized) {
629
641
  const notInstalledItems = [];
630
642
  for (const metadata of this.remoteExtensionMetadata) {
631
643
  if (!metadata.installed && metadata.isPlatformCompatible) {
@@ -768,7 +780,23 @@ RemoteStatusIndicator = RemoteStatusIndicator_1 = ( __decorate([
768
780
  ( __param(14, ITelemetryService)),
769
781
  ( __param(15, IProductService)),
770
782
  ( __param(16, IExtensionManagementService)),
771
- ( __param(17, IOpenerService))
783
+ ( __param(17, IOpenerService)),
784
+ ( __param(18, IConfigurationService))
772
785
  ], RemoteStatusIndicator));
786
+ ( Registry.as(Extensions.Configuration))
787
+ .registerConfiguration({
788
+ ...workbenchConfigurationNodeBase,
789
+ properties: {
790
+ 'workbench.remoteIndicator.showExtensionRecommendations': {
791
+ type: 'boolean',
792
+ markdownDescription: ( localizeWithPath(
793
+ 'vs/workbench/contrib/remote/browser/remoteIndicator',
794
+ 'remote.showExtensionRecommendations',
795
+ "When enabled, remote extensions recommendations will be shown in the Remote Indicator menu."
796
+ )),
797
+ default: true
798
+ },
799
+ }
800
+ });
773
801
 
774
802
  export { RemoteStatusIndicator };
@@ -37,7 +37,7 @@ let RemoteStartEntry = class RemoteStartEntry extends Disposable {
37
37
  "Remote"
38
38
  ));
39
39
  const startEntry = this;
40
- registerAction2(class extends Action2 {
40
+ this._register(registerAction2(class extends Action2 {
41
41
  constructor() {
42
42
  super({
43
43
  id: RemoteStartEntry_1.REMOTE_WEB_START_ENTRY_ACTIONS_COMMAND_ID,
@@ -53,7 +53,7 @@ let RemoteStartEntry = class RemoteStartEntry extends Disposable {
53
53
  async run() {
54
54
  await startEntry.showWebRemoteStartActions();
55
55
  }
56
- });
56
+ }));
57
57
  }
58
58
  registerListeners() {
59
59
  this._register(this.extensionEnablementService.onEnablementChanged(async (result) => {
@@ -272,7 +272,7 @@ const extensionKindSchema = {
272
272
  markdownDescription: ( localizeWithPath(
273
273
  'vs/workbench/contrib/remote/common/remote.contribution',
274
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."
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` by default. Set to `0` to disable the fallback. When `remote.autoForwardPortsFallback` hasn't been configured, but `remote.autoForwardPortsSource` has, `remote.autoForwardPortsFallback` will be treated as though it's set to `0`."
276
276
  ))
277
277
  },
278
278
  'remote.forwardOnOpen': {