@codingame/monaco-vscode-extensions-service-override 25.1.2 → 26.0.1

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 (120) hide show
  1. package/index.js +7 -0
  2. package/package.json +3 -3
  3. package/vscode/src/vs/base/common/console.js +24 -15
  4. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.d.ts +4 -1
  5. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +149 -84
  6. package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +20 -12
  7. package/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.js +38 -21
  8. package/vscode/src/vs/platform/remote/common/managedSocket.js +7 -10
  9. package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +5 -2
  10. package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +5 -2
  11. package/vscode/src/vs/workbench/api/browser/mainThreadAiSettingsSearch.js +4 -1
  12. package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +200 -143
  13. package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +10 -14
  14. package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +41 -31
  15. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +9 -12
  16. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +168 -115
  17. package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.js +11 -13
  18. package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.d.ts +5 -5
  19. package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.js +42 -15
  20. package/vscode/src/vs/workbench/api/browser/mainThreadChatOutputRenderer.js +8 -7
  21. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +4 -2
  22. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +170 -99
  23. package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.js +2 -5
  24. package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +4 -9
  25. package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +13 -12
  26. package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +16 -19
  27. package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +127 -70
  28. package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +80 -26
  29. package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +5 -11
  30. package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +199 -97
  31. package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.js +1 -4
  32. package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +88 -73
  33. package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +5 -5
  34. package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +16 -12
  35. package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +10 -8
  36. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +14 -6
  37. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +52 -37
  38. package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +78 -58
  39. package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +5 -7
  40. package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +75 -63
  41. package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +99 -91
  42. package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +93 -55
  43. package/vscode/src/vs/workbench/api/browser/mainThreadEmbeddings.js +3 -7
  44. package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +85 -60
  45. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +49 -45
  46. package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +114 -72
  47. package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +4 -7
  48. package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +1 -4
  49. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.d.ts +2 -2
  50. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +381 -238
  51. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.d.ts +7 -3
  52. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js +90 -13
  53. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +81 -58
  54. package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +9 -10
  55. package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +2 -7
  56. package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +6 -10
  57. package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +12 -10
  58. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +3 -2
  59. package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +162 -97
  60. package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +32 -26
  61. package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +38 -32
  62. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +48 -46
  63. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +22 -18
  64. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +5 -8
  65. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +35 -21
  66. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +31 -28
  67. package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +5 -7
  68. package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +47 -23
  69. package/vscode/src/vs/workbench/api/browser/mainThreadProfileContentHandlers.js +15 -12
  70. package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +17 -18
  71. package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +6 -7
  72. package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +83 -66
  73. package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +1 -5
  74. package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +250 -92
  75. package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +6 -8
  76. package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +37 -26
  77. package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +34 -21
  78. package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +3 -6
  79. package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +19 -14
  80. package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +41 -16
  81. package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +18 -17
  82. package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +145 -145
  83. package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +19 -11
  84. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +176 -80
  85. package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +52 -21
  86. package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +26 -24
  87. package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +1 -4
  88. package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +5 -8
  89. package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.d.ts +4 -1
  90. package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +106 -46
  91. package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +83 -65
  92. package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +20 -20
  93. package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +14 -9
  94. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +17 -9
  95. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +49 -38
  96. package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +10 -13
  97. package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +38 -27
  98. package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +5 -11
  99. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.d.ts +4 -1
  100. package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +73 -43
  101. package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +2 -2
  102. package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +17 -10
  103. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +17 -11
  104. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +107 -80
  105. package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +336 -175
  106. package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +126 -71
  107. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +76 -54
  108. package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +1 -2
  109. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +2 -0
  110. package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +343 -192
  111. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +5 -3
  112. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.d.ts +0 -1
  113. package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +75 -68
  114. package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +135 -36
  115. package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +22 -18
  116. package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +14 -12
  117. package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +21 -9
  118. package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +48 -25
  119. package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.d.ts +24 -0
  120. package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.js +300 -0
@@ -41,7 +41,7 @@ import { ExtensionHostManager } from './extensionHostManager.js';
41
41
  import { IExtensionManifestPropertiesService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensionManifestPropertiesService.service';
42
42
  import { RemoteRunningLocation, LocalProcessRunningLocation, LocalWebWorkerRunningLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensionRunningLocation';
43
43
  import { ExtensionRunningLocationTracker, filterExtensionIdentifiers } from './extensionRunningLocationTracker.js';
44
- import { toExtensionDescription, ExtensionHostStartup, ActivationKind, ExtensionPointContribution, ActivationTimes, toExtension } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions';
44
+ import { toExtensionDescription, ActivationKind, ExtensionHostStartup, ExtensionPointContribution, ActivationTimes, toExtension } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions';
45
45
  import { ExtensionsRegistry, ExtensionMessageCollector } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
46
46
  import { LazyCreateExtensionHostManager } from './lazyCreateExtensionHostManager.js';
47
47
  import { ResponsiveState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/rpcProtocol';
@@ -55,7 +55,29 @@ var AbstractExtensionService_1;
55
55
  const hasOwnProperty = Object.hasOwnProperty;
56
56
  const NO_OP_VOID_PROMISE = Promise.resolve(undefined);
57
57
  let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtensionService extends Disposable {
58
- constructor(options, _extensionsProposedApi, _extensionHostFactory, _extensionHostKindPicker, _instantiationService, _notificationService, _environmentService, _telemetryService, _extensionEnablementService, _fileService, _productService, _extensionManagementService, _contextService, _configurationService, _extensionManifestPropertiesService, _logService, _remoteAgentService, _remoteExtensionsScannerService, _lifecycleService, _remoteAuthorityResolverService, _dialogService) {
58
+ constructor(
59
+ options,
60
+ _extensionsProposedApi,
61
+ _extensionHostFactory,
62
+ _extensionHostKindPicker,
63
+ _instantiationService,
64
+ _notificationService,
65
+ _environmentService,
66
+ _telemetryService,
67
+ _extensionEnablementService,
68
+ _fileService,
69
+ _productService,
70
+ _extensionManagementService,
71
+ _contextService,
72
+ _configurationService,
73
+ _extensionManifestPropertiesService,
74
+ _logService,
75
+ _remoteAgentService,
76
+ _remoteExtensionsScannerService,
77
+ _lifecycleService,
78
+ _remoteAuthorityResolverService,
79
+ _dialogService
80
+ ) {
59
81
  super();
60
82
  this._extensionsProposedApi = _extensionsProposedApi;
61
83
  this._extensionHostFactory = _extensionHostFactory;
@@ -81,7 +103,9 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
81
103
  this.onDidRegisterExtensions = this._onDidRegisterExtensions.event;
82
104
  this._onDidChangeExtensionsStatus = this._register(( new Emitter()));
83
105
  this.onDidChangeExtensionsStatus = this._onDidChangeExtensionsStatus.event;
84
- this._onDidChangeExtensions = this._register(( new Emitter({ leakWarningThreshold: 400 })));
106
+ this._onDidChangeExtensions = this._register(( new Emitter({
107
+ leakWarningThreshold: 400
108
+ })));
85
109
  this.onDidChangeExtensions = this._onDidChangeExtensions.event;
86
110
  this._onWillActivateByEvent = this._register(( new Emitter()));
87
111
  this.onWillActivateByEvent = this._onWillActivateByEvent.event;
@@ -94,6 +118,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
94
118
  this._installedExtensionsReady = ( new Barrier());
95
119
  this._extensionStatus = ( new ExtensionIdentifierMap());
96
120
  this._allRequestedActivateEvents = ( new Set());
121
+ this._pendingRemoteActivationEvents = ( new Set());
97
122
  this._remoteCrashTracker = ( new ExtensionHostCrashTracker());
98
123
  this._deltaExtensionsQueue = [];
99
124
  this._inHandleDeltaExtensions = false;
@@ -115,23 +140,27 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
115
140
  this._logService,
116
141
  this._extensionManifestPropertiesService
117
142
  ));
118
- this._register(this._extensionEnablementService.onEnablementChanged((extensions) => {
143
+ this._register(this._extensionEnablementService.onEnablementChanged(extensions => {
119
144
  const toAdd = [];
120
145
  const toRemove = [];
121
146
  for (const extension of extensions) {
122
147
  if (this._safeInvokeIsEnabled(extension)) {
123
148
  toAdd.push(extension);
124
- }
125
- else {
149
+ } else {
126
150
  toRemove.push(extension);
127
151
  }
128
152
  }
129
153
  if (isCI) {
130
- this._logService.info(`AbstractExtensionService.onEnablementChanged fired for ${( extensions.map(e => e.identifier.id)).join(', ')}`);
154
+ this._logService.info(`AbstractExtensionService.onEnablementChanged fired for ${( extensions.map(e => e.identifier.id)).join(", ")}`);
131
155
  }
132
156
  this._handleDeltaExtensions(( new DeltaExtensionsQueueItem(toAdd, toRemove)));
133
157
  }));
134
- this._register(this._extensionManagementService.onDidChangeProfile(({ added, removed }) => {
158
+ this._register(this._extensionManagementService.onDidChangeProfile((
159
+ {
160
+ added,
161
+ removed
162
+ }
163
+ ) => {
135
164
  if (added.length || removed.length) {
136
165
  if (isCI) {
137
166
  this._logService.info(`AbstractExtensionService.onDidChangeProfile fired`);
@@ -147,10 +176,13 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
147
176
  this._handleDeltaExtensions(( new DeltaExtensionsQueueItem(extensions, [])));
148
177
  }
149
178
  }));
150
- this._register(this._extensionManagementService.onDidInstallExtensions((result) => {
179
+ this._register(this._extensionManagementService.onDidInstallExtensions(result => {
151
180
  const extensions = [];
152
181
  const toRemove = [];
153
- for (const { local, operation } of result) {
182
+ for (const {
183
+ local,
184
+ operation
185
+ } of result) {
154
186
  if (local && local.isValid && operation !== InstallOperation.Migrate && this._safeInvokeIsEnabled(local)) {
155
187
  extensions.push(local);
156
188
  if (operation === InstallOperation.Update) {
@@ -160,15 +192,19 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
160
192
  }
161
193
  if (extensions.length) {
162
194
  if (isCI) {
163
- this._logService.info(`AbstractExtensionService.onDidInstallExtensions fired for ${( extensions.map(e => e.identifier.id)).join(', ')}`);
195
+ this._logService.info(
196
+ `AbstractExtensionService.onDidInstallExtensions fired for ${( extensions.map(e => e.identifier.id)).join(", ")}`
197
+ );
164
198
  }
165
199
  this._handleDeltaExtensions(( new DeltaExtensionsQueueItem(extensions, toRemove)));
166
200
  }
167
201
  }));
168
- this._register(this._extensionManagementService.onDidUninstallExtension((event) => {
202
+ this._register(this._extensionManagementService.onDidUninstallExtension(event => {
169
203
  if (!event.error) {
170
204
  if (isCI) {
171
- this._logService.info(`AbstractExtensionService.onDidUninstallExtension fired for ${event.identifier.id}`);
205
+ this._logService.info(
206
+ `AbstractExtensionService.onDidUninstallExtension fired for ${event.identifier.id}`
207
+ );
172
208
  }
173
209
  this._handleDeltaExtensions(( new DeltaExtensionsQueueItem([], [event.identifier.id])));
174
210
  }
@@ -180,20 +216,18 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
180
216
  await this._remoteAgentService.endConnection();
181
217
  await this._doStopExtensionHosts();
182
218
  this._remoteAgentService.getConnection()?.dispose();
183
- }
184
- catch {
185
- this._logService.warn('Error while disconnecting remote agent');
219
+ } catch {
220
+ this._logService.warn("Error while disconnecting remote agent");
186
221
  }
187
222
  }, {
188
- id: 'join.disconnectRemote',
189
- label: ( localize(13996, "Disconnect Remote Agent")),
223
+ id: "join.disconnectRemote",
224
+ label: ( localize(14383, "Disconnect Remote Agent")),
190
225
  order: WillShutdownJoinerOrder.Last
191
226
  });
192
- }
193
- else {
227
+ } else {
194
228
  event.join(this._doStopExtensionHosts(), {
195
- id: 'join.stopExtensionHosts',
196
- label: ( localize(13997, "Stopping Extension Hosts")),
229
+ id: "join.stopExtensionHosts",
230
+ label: ( localize(14384, "Stopping Extension Hosts"))
197
231
  });
198
232
  }
199
233
  }));
@@ -210,26 +244,25 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
210
244
  try {
211
245
  this._inHandleDeltaExtensions = true;
212
246
  await this._installedExtensionsReady.wait();
213
- lock = await this._registry.acquireLock('handleDeltaExtensions');
247
+ lock = await this._registry.acquireLock("handleDeltaExtensions");
214
248
  while (this._deltaExtensionsQueue.length > 0) {
215
249
  const item = this._deltaExtensionsQueue.shift();
216
250
  await this._deltaExtensions(lock, item.toAdd, item.toRemove);
217
251
  }
218
- }
219
- finally {
252
+ } finally {
220
253
  this._inHandleDeltaExtensions = false;
221
254
  lock?.dispose();
222
255
  }
223
256
  }
224
257
  async _deltaExtensions(lock, _toAdd, _toRemove) {
225
258
  if (isCI) {
226
- this._logService.info(`AbstractExtensionService._deltaExtensions: toAdd: [${( _toAdd.map(e => e.identifier.id)).join(',')}] toRemove: [${( _toRemove.map(e => typeof e === 'string' ? e : e.identifier.id)).join(',')}]`);
259
+ this._logService.info(`AbstractExtensionService._deltaExtensions: toAdd: [${( _toAdd.map(e => e.identifier.id)).join(",")}] toRemove: [${( _toRemove.map(e => typeof e === "string" ? e : e.identifier.id)).join(",")}]`);
227
260
  }
228
261
  let toRemove = [];
229
262
  for (let i = 0, len = _toRemove.length; i < len; i++) {
230
263
  const extensionOrId = _toRemove[i];
231
- const extensionId = (typeof extensionOrId === 'string' ? extensionOrId : extensionOrId.identifier.id);
232
- const extension = (typeof extensionOrId === 'string' ? null : extensionOrId);
264
+ const extensionId = (typeof extensionOrId === "string" ? extensionOrId : extensionOrId.identifier.id);
265
+ const extension = (typeof extensionOrId === "string" ? null : extensionOrId);
233
266
  const extensionDescription = this._registry.getExtensionDescription(extensionId);
234
267
  if (!extensionDescription) {
235
268
  continue;
@@ -258,15 +291,18 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
258
291
  return;
259
292
  }
260
293
  const result = this._registry.deltaExtensions(lock, toAdd, ( toRemove.map(e => e.identifier)));
261
- this._onDidChangeExtensions.fire({ added: toAdd, removed: toRemove });
294
+ this._onDidChangeExtensions.fire({
295
+ added: toAdd,
296
+ removed: toRemove
297
+ });
262
298
  toRemove = toRemove.concat(result.removedDueToLooping);
263
299
  if (result.removedDueToLooping.length > 0) {
264
300
  this._notificationService.notify({
265
301
  severity: Severity.Error,
266
302
  message: ( localize(
267
- 13998,
303
+ 14385,
268
304
  "The following extensions contain dependency loops and have been disabled: {0}",
269
- ( result.removedDueToLooping.map(e => `'${e.identifier.value}'`)).join(', ')
305
+ ( result.removedDueToLooping.map(e => `'${e.identifier.value}'`)).join(", ")
270
306
  ))
271
307
  });
272
308
  }
@@ -286,14 +322,27 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
286
322
  }
287
323
  async _updateExtensionsOnExtHost(extensionHostManager, versionId, toAdd, toRemove, removedRunningLocation) {
288
324
  const myToAdd = this._runningLocations.filterByExtensionHostManager(toAdd, extensionHostManager);
289
- const myToRemove = filterExtensionIdentifiers(toRemove, removedRunningLocation, extRunningLocation => extensionHostManager.representsRunningLocation(extRunningLocation));
325
+ const myToRemove = filterExtensionIdentifiers(
326
+ toRemove,
327
+ removedRunningLocation,
328
+ extRunningLocation => extensionHostManager.representsRunningLocation(extRunningLocation)
329
+ );
290
330
  const addActivationEvents = ImplicitActivationEvents.createActivationEventsMap(toAdd);
291
331
  if (isCI) {
292
- const printExtIds = (extensions) => ( extensions.map(e => e.identifier.value)).join(',');
293
- const printIds = (extensions) => ( extensions.map(e => e.value)).join(',');
294
- this._logService.info(`AbstractExtensionService: Calling deltaExtensions: toRemove: [${printIds(toRemove)}], toAdd: [${printExtIds(toAdd)}], myToRemove: [${printIds(myToRemove)}], myToAdd: [${printExtIds(myToAdd)}],`);
295
- }
296
- await extensionHostManager.deltaExtensions({ versionId, toRemove, toAdd, addActivationEvents, myToRemove, myToAdd: ( myToAdd.map(extension => extension.identifier)) });
332
+ const printExtIds = extensions => ( extensions.map(e => e.identifier.value)).join(",");
333
+ const printIds = extensions => ( extensions.map(e => e.value)).join(",");
334
+ this._logService.info(
335
+ `AbstractExtensionService: Calling deltaExtensions: toRemove: [${printIds(toRemove)}], toAdd: [${printExtIds(toAdd)}], myToRemove: [${printIds(myToRemove)}], myToAdd: [${printExtIds(myToAdd)}],`
336
+ );
337
+ }
338
+ await extensionHostManager.deltaExtensions({
339
+ versionId,
340
+ toRemove,
341
+ toAdd,
342
+ addActivationEvents,
343
+ myToRemove,
344
+ myToAdd: ( myToAdd.map(extension => extension.identifier))
345
+ });
297
346
  }
298
347
  canAddExtension(extension) {
299
348
  return this._canAddExtension(extension, []);
@@ -302,7 +351,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
302
351
  const existing = this._registry.getExtensionDescriptionByIdOrUUID(extension.identifier, extension.id);
303
352
  if (existing) {
304
353
  const isBeingRemoved = ( extensionsBeingRemoved.some(
305
- (extensionDescription) => ExtensionIdentifier.equals(extension.identifier, extensionDescription.identifier)
354
+ extensionDescription => ExtensionIdentifier.equals(extension.identifier, extensionDescription.identifier)
306
355
  ));
307
356
  if (!isBeingRemoved) {
308
357
  return false;
@@ -310,7 +359,13 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
310
359
  }
311
360
  const extensionKinds = this._runningLocations.readExtensionKinds(extension);
312
361
  const isRemote = extension.extensionLocation.scheme === Schemas.vscodeRemote;
313
- const extensionHostKind = this._extensionHostKindPicker.pickExtensionHostKind(extension.identifier, extensionKinds, !isRemote, isRemote, ExtensionRunningPreference.None);
362
+ const extensionHostKind = this._extensionHostKindPicker.pickExtensionHostKind(
363
+ extension.identifier,
364
+ extensionKinds,
365
+ !isRemote,
366
+ isRemote,
367
+ ExtensionRunningPreference.None
368
+ );
314
369
  if (extensionHostKind === null) {
315
370
  return false;
316
371
  }
@@ -327,52 +382,49 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
327
382
  return true;
328
383
  }
329
384
  async _activateAddedExtensionIfNeeded(extensionDescription) {
330
- let shouldActivate = false;
331
385
  let shouldActivateReason = null;
332
386
  let hasWorkspaceContains = false;
333
387
  const activationEvents = this._activationEventReader.readActivationEvents(extensionDescription);
334
388
  for (const activationEvent of activationEvents) {
335
389
  if (( this._allRequestedActivateEvents.has(activationEvent))) {
336
- shouldActivate = true;
337
390
  shouldActivateReason = activationEvent;
338
391
  break;
339
392
  }
340
- if (activationEvent === '*') {
341
- shouldActivate = true;
393
+ if (activationEvent === "*") {
342
394
  shouldActivateReason = activationEvent;
343
395
  break;
344
396
  }
345
397
  if (/^workspaceContains/.test(activationEvent)) {
346
398
  hasWorkspaceContains = true;
347
399
  }
348
- if (activationEvent === 'onStartupFinished') {
349
- shouldActivate = true;
400
+ if (activationEvent === "onStartupFinished") {
350
401
  shouldActivateReason = activationEvent;
351
402
  break;
352
403
  }
353
404
  }
354
- if (shouldActivate) {
355
- await Promise.all(( this._extensionHostManagers.map(
356
- extHostManager => extHostManager.activate(extensionDescription.identifier, { startup: false, extensionId: extensionDescription.identifier, activationEvent: shouldActivateReason })
357
- ))).then(() => { });
358
- }
359
- else if (hasWorkspaceContains) {
405
+ if (!shouldActivateReason && hasWorkspaceContains) {
360
406
  const workspace = await this._contextService.getCompleteWorkspace();
361
407
  const forceUsingSearch = !!this._environmentService.remoteAuthority;
362
408
  const host = {
363
409
  logService: this._logService,
364
410
  folders: ( workspace.folders.map(folder => folder.uri)),
365
411
  forceUsingSearch: forceUsingSearch,
366
- exists: (uri) => this._fileService.exists(uri),
367
- checkExists: (folders, includes, token) => this._instantiationService.invokeFunction((accessor) => checkGlobFileExists(accessor, folders, includes, token))
412
+ exists: uri => this._fileService.exists(uri),
413
+ checkExists: (folders, includes, token) => this._instantiationService.invokeFunction(accessor => checkGlobFileExists(accessor, folders, includes, token))
368
414
  };
369
415
  const result = await checkActivateWorkspaceContainsExtension(host, extensionDescription);
370
- if (!result) {
371
- return;
416
+ if (result) {
417
+ shouldActivateReason = result.activationEvent;
372
418
  }
419
+ }
420
+ if (shouldActivateReason) {
373
421
  await Promise.all(( this._extensionHostManagers.map(
374
- extHostManager => extHostManager.activate(extensionDescription.identifier, { startup: false, extensionId: extensionDescription.identifier, activationEvent: result.activationEvent })
375
- ))).then(() => { });
422
+ extHostManager => extHostManager.activate(extensionDescription.identifier, {
423
+ startup: false,
424
+ extensionId: extensionDescription.identifier,
425
+ activationEvent: shouldActivateReason
426
+ })
427
+ )));
376
428
  }
377
429
  }
378
430
  _initializeIfNeeded() {
@@ -382,35 +434,75 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
382
434
  return this._initializePromise;
383
435
  }
384
436
  async _initialize() {
385
- mark('code/willLoadExtensions');
437
+ mark("code/willLoadExtensions");
386
438
  this._startExtensionHostsIfNecessary(true, []);
387
- const lock = await this._registry.acquireLock('_initialize');
439
+ const lock = await this._registry.acquireLock("_initialize");
388
440
  try {
389
441
  await this._resolveAndProcessExtensions(lock);
390
442
  this._startOnDemandExtensionHosts();
391
- }
392
- finally {
443
+ } finally {
393
444
  lock.dispose();
394
445
  }
395
446
  this._releaseBarrier();
396
- mark('code/didLoadExtensions');
447
+ mark("code/didLoadExtensions");
448
+ this._activateDeferredRemoteEvents();
397
449
  await this._handleExtensionTests();
398
450
  }
451
+ async _activateDeferredRemoteEvents() {
452
+ if (this._pendingRemoteActivationEvents.size === 0) {
453
+ return;
454
+ }
455
+ const remoteExtensionHosts = this._getExtensionHostManagers(ExtensionHostKind.Remote);
456
+ if (remoteExtensionHosts.length === 0) {
457
+ this._pendingRemoteActivationEvents.clear();
458
+ return;
459
+ }
460
+ await Promise.all(( remoteExtensionHosts.map(extHost => extHost.ready())));
461
+ for (const activationEvent of this._pendingRemoteActivationEvents) {
462
+ const result = Promise.all(( remoteExtensionHosts.map(
463
+ extHostManager => extHostManager.activateByEvent(activationEvent, ActivationKind.Normal)
464
+ ))).then(() => {});
465
+ this._onWillActivateByEvent.fire({
466
+ event: activationEvent,
467
+ activation: result,
468
+ activationKind: ActivationKind.Normal
469
+ });
470
+ }
471
+ this._pendingRemoteActivationEvents.clear();
472
+ }
399
473
  async _resolveAndProcessExtensions(lock) {
400
474
  let resolverExtensions = [];
401
475
  let localExtensions = [];
402
476
  let remoteExtensions = [];
403
477
  for await (const extensions of this._resolveExtensions()) {
404
478
  if (extensions instanceof ResolverExtensions) {
405
- resolverExtensions = checkEnabledAndProposedAPI(this._logService, this._extensionEnablementService, this._extensionsProposedApi, extensions.extensions, false);
479
+ resolverExtensions = checkEnabledAndProposedAPI(
480
+ this._logService,
481
+ this._extensionEnablementService,
482
+ this._extensionsProposedApi,
483
+ extensions.extensions,
484
+ false
485
+ );
406
486
  this._registry.deltaExtensions(lock, resolverExtensions, []);
407
487
  this._doHandleExtensionPoints(resolverExtensions, true);
408
488
  }
409
489
  if (extensions instanceof LocalExtensions) {
410
- localExtensions = checkEnabledAndProposedAPI(this._logService, this._extensionEnablementService, this._extensionsProposedApi, extensions.extensions, false);
490
+ localExtensions = checkEnabledAndProposedAPI(
491
+ this._logService,
492
+ this._extensionEnablementService,
493
+ this._extensionsProposedApi,
494
+ extensions.extensions,
495
+ false
496
+ );
411
497
  }
412
498
  if (extensions instanceof RemoteExtensions) {
413
- remoteExtensions = checkEnabledAndProposedAPI(this._logService, this._extensionEnablementService, this._extensionsProposedApi, extensions.extensions, false);
499
+ remoteExtensions = checkEnabledAndProposedAPI(
500
+ this._logService,
501
+ this._extensionEnablementService,
502
+ this._extensionsProposedApi,
503
+ extensions.extensions,
504
+ false
505
+ );
414
506
  }
415
507
  }
416
508
  this._runningLocations.initializeRunningLocation(localExtensions, remoteExtensions);
@@ -445,9 +537,9 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
445
537
  this._notificationService.notify({
446
538
  severity: Severity.Error,
447
539
  message: ( localize(
448
- 13998,
540
+ 14385,
449
541
  "The following extensions contain dependency loops and have been disabled: {0}",
450
- ( result.removedDueToLooping.map(e => `'${e.identifier.value}'`)).join(', ')
542
+ ( result.removedDueToLooping.map(e => `'${e.identifier.value}'`)).join(", ")
451
543
  ))
452
544
  });
453
545
  }
@@ -460,7 +552,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
460
552
  const extensionHostManager = this.findTestExtensionHost(this._environmentService.extensionTestsLocationURI);
461
553
  if (!extensionHostManager) {
462
554
  const msg = ( localize(
463
- 13999,
555
+ 14386,
464
556
  "No extension host found that can launch the test runner at {0}.",
465
557
  (this._environmentService.extensionTestsLocationURI.toString())
466
558
  ));
@@ -474,8 +566,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
474
566
  if (isCI) {
475
567
  this._logService.info(`Extension host test runner exit code: ${exitCode}`);
476
568
  }
477
- }
478
- catch (err) {
569
+ } catch (err) {
479
570
  if (isCI) {
480
571
  this._logService.error(`Extension host test runner error`, err);
481
572
  }
@@ -495,8 +586,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
495
586
  if (runningLocation === null) {
496
587
  if (testLocation.scheme === Schemas.vscodeRemote) {
497
588
  runningLocation = ( new RemoteRunningLocation());
498
- }
499
- else {
589
+ } else {
500
590
  runningLocation = ( new LocalProcessRunningLocation(0));
501
591
  }
502
592
  }
@@ -512,11 +602,10 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
512
602
  }
513
603
  async _resolveAuthorityInitial(remoteAuthority) {
514
604
  const MAX_ATTEMPTS = 5;
515
- for (let attempt = 1;; attempt++) {
605
+ for (let attempt = 1; ; attempt++) {
516
606
  try {
517
607
  return this._resolveAuthorityWithLogging(remoteAuthority);
518
- }
519
- catch (err) {
608
+ } catch (err) {
520
609
  if (RemoteAuthorityResolverError.isNoResolverFound(err)) {
521
610
  throw err;
522
611
  }
@@ -538,8 +627,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
538
627
  try {
539
628
  const result = await this._resolveAuthorityWithLogging(remoteAuthority);
540
629
  this._remoteAuthorityResolverService._setResolvedAuthority(result.authority, result.options);
541
- }
542
- catch (err) {
630
+ } catch (err) {
543
631
  this._remoteAuthorityResolverService._setResolvedAuthorityError(remoteAuthority, err);
544
632
  }
545
633
  }
@@ -551,12 +639,16 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
551
639
  mark(`code/willResolveAuthority/${authorityPrefix}`);
552
640
  const result = await this._resolveAuthority(remoteAuthority);
553
641
  mark(`code/didResolveAuthorityOK/${authorityPrefix}`);
554
- this._logService.info(`resolveAuthority(${authorityPrefix}) returned '${result.authority.connectTo}' after ${sw.elapsed()} ms`);
642
+ this._logService.info(
643
+ `resolveAuthority(${authorityPrefix}) returned '${result.authority.connectTo}' after ${sw.elapsed()} ms`
644
+ );
555
645
  return result;
556
- }
557
- catch (err) {
646
+ } catch (err) {
558
647
  mark(`code/didResolveAuthorityError/${authorityPrefix}`);
559
- this._logService.error(`resolveAuthority(${authorityPrefix}) returned an error after ${sw.elapsed()} ms`, err);
648
+ this._logService.error(
649
+ `resolveAuthority(${authorityPrefix}) returned an error after ${sw.elapsed()} ms`,
650
+ err
651
+ );
560
652
  throw err;
561
653
  }
562
654
  }
@@ -571,7 +663,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
571
663
  )));
572
664
  let bestErrorResult = null;
573
665
  for (const result of results) {
574
- if (result.type === 'ok') {
666
+ if (result.type === "ok") {
575
667
  return result.value;
576
668
  }
577
669
  if (!bestErrorResult) {
@@ -590,7 +682,8 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
590
682
  bestErrorResult.error.detail
591
683
  ));
592
684
  }
593
- stopExtensionHosts(reason, auto) {
685
+ async stopExtensionHosts(reason, auto) {
686
+ await this._initializeIfNeeded();
594
687
  return this._doStopExtensionHostsWithVeto(reason, auto);
595
688
  }
596
689
  async _doStopExtensionHosts() {
@@ -619,18 +712,17 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
619
712
  auto,
620
713
  veto(value, reason) {
621
714
  vetos.push(value);
622
- if (typeof value === 'boolean') {
715
+ if (typeof value === "boolean") {
623
716
  if (value === true) {
624
717
  vetoReasons.add(reason);
625
718
  }
626
- }
627
- else {
719
+ } else {
628
720
  value.then(value => {
629
721
  if (value) {
630
722
  vetoReasons.add(reason);
631
723
  }
632
724
  }).catch(error => {
633
- vetoReasons.add(( localize(14000, "{0} (Error: {1})", reason, toErrorMessage(error))));
725
+ vetoReasons.add(( localize(14387, "{0} (Error: {1})", reason, toErrorMessage(error))));
634
726
  });
635
727
  }
636
728
  }
@@ -638,18 +730,19 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
638
730
  const veto = await handleVetos(vetos, error => this._logService.error(error));
639
731
  if (!veto) {
640
732
  await this._doStopExtensionHosts();
641
- }
642
- else {
733
+ } else {
643
734
  if (!auto) {
644
735
  const vetoReasonsArray = Array.from(vetoReasons);
645
- this._logService.warn(`Extension host was not stopped because of veto (stop reason: ${reason}, veto reason: ${vetoReasonsArray.join(', ')})`);
646
- const { confirmed } = await this._dialogService.confirm({
736
+ this._logService.warn(
737
+ `Extension host was not stopped because of veto (stop reason: ${reason}, veto reason: ${vetoReasonsArray.join(", ")})`
738
+ );
739
+ const {
740
+ confirmed
741
+ } = await this._dialogService.confirm({
647
742
  type: Severity.Warning,
648
- message: ( localize(14001, "Please confirm restart of extensions.")),
649
- detail: vetoReasonsArray.length === 1 ?
650
- vetoReasonsArray[0] :
651
- vetoReasonsArray.join('\n -'),
652
- primaryButton: ( localize(14002, "Restart Anyway"))
743
+ message: ( localize(14388, "Please confirm restart of extensions.")),
744
+ detail: vetoReasonsArray.length === 1 ? vetoReasonsArray[0] : vetoReasonsArray.join("\n -"),
745
+ primaryButton: ( localize(14389, "Restart Anyway"))
653
746
  });
654
747
  if (confirmed) {
655
748
  return true;
@@ -685,13 +778,17 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
685
778
  }
686
779
  const processManager = this._doCreateExtensionHostManager(extensionHost, initialActivationEvents);
687
780
  const disposableStore = ( new DisposableStore());
688
- disposableStore.add(processManager.onDidExit(([code, signal]) => this._onExtensionHostCrashOrExit(processManager, code, signal)));
689
- disposableStore.add(processManager.onDidChangeResponsiveState((responsiveState) => {
690
- this._logService.info(`Extension host (${processManager.friendyName}) is ${responsiveState === ResponsiveState.Responsive ? 'responsive' : 'unresponsive'}.`);
781
+ disposableStore.add(processManager.onDidExit(
782
+ ([code, signal]) => this._onExtensionHostCrashOrExit(processManager, code, signal)
783
+ ));
784
+ disposableStore.add(processManager.onDidChangeResponsiveState(responsiveState => {
785
+ this._logService.info(
786
+ `Extension host (${processManager.friendyName}) is ${responsiveState === ResponsiveState.Responsive ? "responsive" : "unresponsive"}.`
787
+ );
691
788
  this._onDidChangeResponsiveChange.fire({
692
789
  extensionHostKind: processManager.kind,
693
790
  isResponsive: responsiveState === ResponsiveState.Responsive,
694
- getInspectListener: (tryEnableInspector) => {
791
+ getInspectListener: tryEnableInspector => {
695
792
  return processManager.getInspectPort(tryEnableInspector);
696
793
  }
697
794
  });
@@ -701,9 +798,19 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
701
798
  _doCreateExtensionHostManager(extensionHost, initialActivationEvents) {
702
799
  const internalExtensionService = this._acquireInternalAPI(extensionHost);
703
800
  if (extensionHost.startup === ExtensionHostStartup.LazyAutoStart) {
704
- return this._instantiationService.createInstance(LazyCreateExtensionHostManager, extensionHost, initialActivationEvents, internalExtensionService);
705
- }
706
- return this._instantiationService.createInstance(ExtensionHostManager, extensionHost, initialActivationEvents, internalExtensionService);
801
+ return this._instantiationService.createInstance(
802
+ LazyCreateExtensionHostManager,
803
+ extensionHost,
804
+ initialActivationEvents,
805
+ internalExtensionService
806
+ );
807
+ }
808
+ return this._instantiationService.createInstance(
809
+ ExtensionHostManager,
810
+ extensionHost,
811
+ initialActivationEvents,
812
+ internalExtensionService
813
+ );
707
814
  }
708
815
  _onExtensionHostCrashOrExit(extensionHost, code, signal) {
709
816
  const isExtensionDevHost = parseExtensionDevOptions(this._environmentService).isExtensionDevHost;
@@ -714,11 +821,12 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
714
821
  this._onExtensionHostExit(code);
715
822
  }
716
823
  _onExtensionHostCrashed(extensionHost, code, signal) {
717
- console.error(`Extension host (${extensionHost.friendyName}) terminated unexpectedly. Code: ${code}, Signal: ${signal}`);
824
+ console.error(
825
+ `Extension host (${extensionHost.friendyName}) terminated unexpectedly. Code: ${code}, Signal: ${signal}`
826
+ );
718
827
  if (extensionHost.kind === ExtensionHostKind.LocalProcess) {
719
828
  this._doStopExtensionHosts();
720
- }
721
- else if (extensionHost.kind === ExtensionHostKind.Remote) {
829
+ } else if (extensionHost.kind === ExtensionHostKind.Remote) {
722
830
  if (signal) {
723
831
  this._onRemoteExtensionHostCrashed(extensionHost, signal);
724
832
  }
@@ -728,9 +836,9 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
728
836
  _getExtensionHostExitInfoWithTimeout(reconnectionToken) {
729
837
  return ( new Promise((resolve, reject) => {
730
838
  const timeoutHandle = setTimeout(() => {
731
- reject(( new Error('getExtensionHostExitInfo timed out')));
839
+ reject(( new Error("getExtensionHostExitInfo timed out")));
732
840
  }, 2000);
733
- this._remoteAgentService.getExtensionHostExitInfo(reconnectionToken).then((r) => {
841
+ this._remoteAgentService.getExtensionHostExitInfo(reconnectionToken).then(r => {
734
842
  clearTimeout(timeoutHandle);
735
843
  resolve(r);
736
844
  }, reject);
@@ -740,29 +848,30 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
740
848
  try {
741
849
  const info = await this._getExtensionHostExitInfoWithTimeout(reconnectionToken);
742
850
  if (info) {
743
- this._logService.error(`Extension host (${extensionHost.friendyName}) terminated unexpectedly with code ${info.code}.`);
851
+ this._logService.error(
852
+ `Extension host (${extensionHost.friendyName}) terminated unexpectedly with code ${info.code}.`
853
+ );
744
854
  }
745
855
  this._logExtensionHostCrash(extensionHost);
746
856
  this._remoteCrashTracker.registerCrash();
747
857
  if (this._remoteCrashTracker.shouldAutomaticallyRestart()) {
748
858
  this._logService.info(`Automatically restarting the remote extension host.`);
749
- this._notificationService.status(( localize(14003, "The remote extension host terminated unexpectedly. Restarting...")), { hideAfter: 5000 });
859
+ this._notificationService.status(( localize(14390, "The remote extension host terminated unexpectedly. Restarting...")), {
860
+ hideAfter: 5000
861
+ });
750
862
  this._startExtensionHostsIfNecessary(false, Array.from(( this._allRequestedActivateEvents.keys())));
751
- }
752
- else {
863
+ } else {
753
864
  this._notificationService.prompt(Severity.Error, ( localize(
754
- 14004,
865
+ 14391,
755
866
  "Remote Extension host terminated unexpectedly 3 times within the last 5 minutes."
756
867
  )), [{
757
- label: ( localize(14005, "Restart Remote Extension Host")),
758
- run: () => {
759
- this._startExtensionHostsIfNecessary(false, Array.from(( this._allRequestedActivateEvents.keys())));
760
- }
761
- }]);
868
+ label: ( localize(14392, "Restart Remote Extension Host")),
869
+ run: () => {
870
+ this._startExtensionHostsIfNecessary(false, Array.from(( this._allRequestedActivateEvents.keys())));
871
+ }
872
+ }]);
762
873
  }
763
- }
764
- catch (err) {
765
- }
874
+ } catch (err) {}
766
875
  }
767
876
  _logExtensionHostCrash(extensionHost) {
768
877
  const activatedExtensions = [];
@@ -772,10 +881,13 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
772
881
  }
773
882
  }
774
883
  if (activatedExtensions.length > 0) {
775
- this._logService.error(`Extension host (${extensionHost.friendyName}) terminated unexpectedly. The following extensions were running: ${( activatedExtensions.map(id => id.value)).join(', ')}`);
776
- }
777
- else {
778
- this._logService.error(`Extension host (${extensionHost.friendyName}) terminated unexpectedly. No extensions were activated.`);
884
+ this._logService.error(
885
+ `Extension host (${extensionHost.friendyName}) terminated unexpectedly. The following extensions were running: ${( activatedExtensions.map(id => id.value)).join(", ")}`
886
+ );
887
+ } else {
888
+ this._logService.error(
889
+ `Extension host (${extensionHost.friendyName}) terminated unexpectedly. No extensions were activated.`
890
+ );
779
891
  }
780
892
  }
781
893
  async startExtensionHosts(updates) {
@@ -783,14 +895,13 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
783
895
  if (updates) {
784
896
  await this._handleDeltaExtensions(( new DeltaExtensionsQueueItem(updates.toAdd, updates.toRemove)));
785
897
  }
786
- const lock = await this._registry.acquireLock('startExtensionHosts');
898
+ const lock = await this._registry.acquireLock("startExtensionHosts");
787
899
  try {
788
900
  this._startExtensionHostsIfNecessary(false, Array.from(( this._allRequestedActivateEvents.keys())));
789
901
  this._startOnDemandExtensionHosts();
790
902
  const localProcessExtensionHosts = this._getExtensionHostManagers(ExtensionHostKind.LocalProcess);
791
903
  await Promise.all(( localProcessExtensionHosts.map(extHost => extHost.ready())));
792
- }
793
- finally {
904
+ } finally {
794
905
  lock.dispose();
795
906
  }
796
907
  }
@@ -810,8 +921,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
810
921
  return NO_OP_VOID_PROMISE;
811
922
  }
812
923
  return this._activateByEvent(activationEvent, activationKind);
813
- }
814
- else {
924
+ } else {
815
925
  this._allRequestedActivateEvents.add(activationEvent);
816
926
  if (activationKind === ActivationKind.Immediate) {
817
927
  void this._initializeIfNeeded();
@@ -821,12 +931,22 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
821
931
  }
822
932
  }
823
933
  _activateByEvent(activationEvent, activationKind) {
824
- const result = Promise.all(( this._extensionHostManagers.map(
934
+ let managers;
935
+ if (activationKind === ActivationKind.Immediate) {
936
+ managers = this._extensionHostManagers.filter(
937
+ extHostManager => extHostManager.kind === ExtensionHostKind.LocalProcess || extHostManager.kind === ExtensionHostKind.LocalWebWorker
938
+ );
939
+ this._pendingRemoteActivationEvents.add(activationEvent);
940
+ } else {
941
+ managers = [...this._extensionHostManagers];
942
+ }
943
+ const result = Promise.all(( managers.map(
825
944
  extHostManager => extHostManager.activateByEvent(activationEvent, activationKind)
826
- ))).then(() => { });
945
+ ))).then(() => {});
827
946
  this._onWillActivateByEvent.fire({
828
947
  event: activationEvent,
829
- activation: result
948
+ activation: result,
949
+ activationKind
830
950
  });
831
951
  return result;
832
952
  }
@@ -880,31 +1000,32 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
880
1000
  activationStarted: extensionStatus?.activationStarted ?? false,
881
1001
  activationTimes: extensionStatus?.activationTimes ?? undefined,
882
1002
  runtimeErrors: extensionStatus?.runtimeErrors ?? [],
883
- runningLocation: this._runningLocations.getRunningLocation(extension.identifier),
1003
+ runningLocation: this._runningLocations.getRunningLocation(extension.identifier)
884
1004
  };
885
1005
  }
886
1006
  }
887
1007
  return result;
888
1008
  }
889
1009
  async getInspectPorts(extensionHostKind, tryEnableInspector) {
890
- const result = await Promise.all(( this._getExtensionHostManagers(extensionHostKind).map(async (extHost) => {
1010
+ const result = await Promise.all(( this._getExtensionHostManagers(extensionHostKind).map(async extHost => {
891
1011
  let portInfo = await extHost.getInspectPort(tryEnableInspector);
892
1012
  if (portInfo !== undefined) {
893
- portInfo = { ...portInfo, devtoolsLabel: extHost.friendyName };
1013
+ portInfo = {
1014
+ ...portInfo,
1015
+ devtoolsLabel: extHost.friendyName
1016
+ };
894
1017
  }
895
1018
  return portInfo;
896
1019
  })));
897
1020
  return result.filter(isDefined);
898
1021
  }
899
1022
  async setRemoteEnvironment(env) {
900
- await ( this._extensionHostManagers
901
- .map(manager => manager.setRemoteEnvironment(env)));
1023
+ await ( this._extensionHostManagers.map(manager => manager.setRemoteEnvironment(env)));
902
1024
  }
903
1025
  _safeInvokeIsEnabled(extension) {
904
1026
  try {
905
1027
  return this._extensionEnablementService.isEnabled(extension);
906
- }
907
- catch (err) {
1028
+ } catch (err) {
908
1029
  return false;
909
1030
  }
910
1031
  }
@@ -919,10 +1040,12 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
919
1040
  }
920
1041
  }
921
1042
  }
922
- const messageHandler = (msg) => this._handleExtensionPointMessage(msg);
1043
+ const messageHandler = msg => this._handleExtensionPointMessage(msg);
923
1044
  const availableExtensions = this._registry.getAllExtensionDescriptions();
924
1045
  const extensionPoints = ExtensionsRegistry.getExtensionPoints();
925
- mark(onlyResolverExtensionPoints ? 'code/willHandleResolverExtensionPoints' : 'code/willHandleExtensionPoints');
1046
+ mark(
1047
+ onlyResolverExtensionPoints ? "code/willHandleResolverExtensionPoints" : "code/willHandleExtensionPoints"
1048
+ );
926
1049
  for (const extensionPoint of extensionPoints) {
927
1050
  if (affectedExtensionPoints[extensionPoint.name] && (!onlyResolverExtensionPoints || extensionPoint.canHandleResolver)) {
928
1051
  mark(`code/willHandleExtensionPoint/${extensionPoint.name}`);
@@ -930,7 +1053,9 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
930
1053
  mark(`code/didHandleExtensionPoint/${extensionPoint.name}`);
931
1054
  }
932
1055
  }
933
- mark(onlyResolverExtensionPoints ? 'code/didHandleResolverExtensionPoints' : 'code/didHandleExtensionPoints');
1056
+ mark(
1057
+ onlyResolverExtensionPoints ? "code/didHandleResolverExtensionPoints" : "code/didHandleExtensionPoints"
1058
+ );
934
1059
  }
935
1060
  _getOrCreateExtensionStatus(extensionId) {
936
1061
  if (!( this._extensionStatus.has(extensionId))) {
@@ -945,23 +1070,35 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
945
1070
  const strMsg = `[${msg.extensionId.value}]: ${msg.message}`;
946
1071
  if (msg.type === Severity.Error) {
947
1072
  if (extension && extension.isUnderDevelopment) {
948
- this._notificationService.notify({ severity: Severity.Error, message: strMsg });
1073
+ this._notificationService.notify({
1074
+ severity: Severity.Error,
1075
+ message: strMsg
1076
+ });
949
1077
  }
950
1078
  this._logService.error(strMsg);
951
- }
952
- else if (msg.type === Severity.Warning) {
1079
+ } else if (msg.type === Severity.Warning) {
953
1080
  if (extension && extension.isUnderDevelopment) {
954
- this._notificationService.notify({ severity: Severity.Warning, message: strMsg });
1081
+ this._notificationService.notify({
1082
+ severity: Severity.Warning,
1083
+ message: strMsg
1084
+ });
955
1085
  }
956
1086
  this._logService.warn(strMsg);
957
- }
958
- else {
1087
+ } else {
959
1088
  this._logService.info(strMsg);
960
1089
  }
961
1090
  if (msg.extensionId && this._environmentService.isBuilt && !this._environmentService.isExtensionDevelopment) {
962
- const { type, extensionId, extensionPointId, message } = msg;
963
- this._telemetryService.publicLog2('extensionsMessage', {
964
- type, extensionId: extensionId.value, extensionPointId, message
1091
+ const {
1092
+ type,
1093
+ extensionId,
1094
+ extensionPointId,
1095
+ message
1096
+ } = msg;
1097
+ this._telemetryService.publicLog2("extensionsMessage", {
1098
+ type,
1099
+ extensionId: extensionId.value,
1100
+ extensionPointId,
1101
+ message
965
1102
  });
966
1103
  }
967
1104
  }
@@ -983,11 +1120,23 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
983
1120
  _activateById: (extensionId, reason) => {
984
1121
  return this._activateById(extensionId, reason);
985
1122
  },
986
- _onWillActivateExtension: (extensionId) => {
1123
+ _onWillActivateExtension: extensionId => {
987
1124
  return this._onWillActivateExtension(extensionId, extensionHost.runningLocation);
988
1125
  },
989
- _onDidActivateExtension: (extensionId, codeLoadingTime, activateCallTime, activateResolvedTime, activationReason) => {
990
- return this._onDidActivateExtension(extensionId, codeLoadingTime, activateCallTime, activateResolvedTime, activationReason);
1126
+ _onDidActivateExtension: (
1127
+ extensionId,
1128
+ codeLoadingTime,
1129
+ activateCallTime,
1130
+ activateResolvedTime,
1131
+ activationReason
1132
+ ) => {
1133
+ return this._onDidActivateExtension(
1134
+ extensionId,
1135
+ codeLoadingTime,
1136
+ activateCallTime,
1137
+ activateResolvedTime,
1138
+ activationReason
1139
+ );
991
1140
  },
992
1141
  _onDidActivateExtensionError: (extensionId, error) => {
993
1142
  return this._onDidActivateExtensionError(extensionId, error);
@@ -1009,13 +1158,19 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
1009
1158
  const extensionStatus = this._getOrCreateExtensionStatus(extensionId);
1010
1159
  extensionStatus.onWillActivate();
1011
1160
  }
1012
- _onDidActivateExtension(extensionId, codeLoadingTime, activateCallTime, activateResolvedTime, activationReason) {
1161
+ _onDidActivateExtension(
1162
+ extensionId,
1163
+ codeLoadingTime,
1164
+ activateCallTime,
1165
+ activateResolvedTime,
1166
+ activationReason
1167
+ ) {
1013
1168
  const extensionStatus = this._getOrCreateExtensionStatus(extensionId);
1014
1169
  extensionStatus.setActivationTimes(( new ActivationTimes(codeLoadingTime, activateCallTime, activateResolvedTime, activationReason)));
1015
1170
  this._onDidChangeExtensionsStatus.fire([extensionId]);
1016
1171
  }
1017
1172
  _onDidActivateExtensionError(extensionId, error) {
1018
- this._telemetryService.publicLog2('extensionActivationError', {
1173
+ this._telemetryService.publicLog2("extensionActivationError", {
1019
1174
  extensionId: extensionId.value,
1020
1175
  error: error.message
1021
1176
  });
@@ -1026,25 +1181,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
1026
1181
  this._onDidChangeExtensionsStatus.fire([extensionId]);
1027
1182
  }
1028
1183
  };
1029
- AbstractExtensionService = AbstractExtensionService_1 = ( __decorate([
1030
- ( __param(4, IInstantiationService)),
1031
- ( __param(5, INotificationService)),
1032
- ( __param(6, IWorkbenchEnvironmentService)),
1033
- ( __param(7, ITelemetryService)),
1034
- ( __param(8, IWorkbenchExtensionEnablementService)),
1035
- ( __param(9, IFileService)),
1036
- ( __param(10, IProductService)),
1037
- ( __param(11, IWorkbenchExtensionManagementService)),
1038
- ( __param(12, IWorkspaceContextService)),
1039
- ( __param(13, IConfigurationService)),
1040
- ( __param(14, IExtensionManifestPropertiesService)),
1041
- ( __param(15, ILogService)),
1042
- ( __param(16, IRemoteAgentService)),
1043
- ( __param(17, IRemoteExtensionsScannerService)),
1044
- ( __param(18, ILifecycleService)),
1045
- ( __param(19, IRemoteAuthorityResolverService)),
1046
- ( __param(20, IDialogService))
1047
- ], AbstractExtensionService));
1184
+ AbstractExtensionService = AbstractExtensionService_1 = ( __decorate([( __param(4, IInstantiationService)), ( __param(5, INotificationService)), ( __param(6, IWorkbenchEnvironmentService)), ( __param(7, ITelemetryService)), ( __param(8, IWorkbenchExtensionEnablementService)), ( __param(9, IFileService)), ( __param(10, IProductService)), ( __param(11, IWorkbenchExtensionManagementService)), ( __param(12, IWorkspaceContextService)), ( __param(13, IConfigurationService)), ( __param(14, IExtensionManifestPropertiesService)), ( __param(15, ILogService)), ( __param(16, IRemoteAgentService)), ( __param(17, IRemoteExtensionsScannerService)), ( __param(18, ILifecycleService)), ( __param(19, IRemoteAuthorityResolverService)), ( __param(20, IDialogService))], AbstractExtensionService));
1048
1185
  class ExtensionHostCollection extends Disposable {
1049
1186
  constructor() {
1050
1187
  super(...arguments);
@@ -1136,9 +1273,15 @@ class DeltaExtensionsQueueItem {
1136
1273
  }
1137
1274
  }
1138
1275
  function isResolverExtension(extension) {
1139
- return !!extension.activationEvents?.some(activationEvent => activationEvent.startsWith('onResolveRemoteAuthority:'));
1276
+ return !!extension.activationEvents?.some(activationEvent => activationEvent.startsWith("onResolveRemoteAuthority:"));
1140
1277
  }
1141
- function checkEnabledAndProposedAPI(logService, extensionEnablementService, extensionsProposedApi, extensions, ignoreWorkspaceTrust) {
1278
+ function checkEnabledAndProposedAPI(
1279
+ logService,
1280
+ extensionEnablementService,
1281
+ extensionsProposedApi,
1282
+ extensions,
1283
+ ignoreWorkspaceTrust
1284
+ ) {
1142
1285
  extensionsProposedApi.updateEnabledApiProposals(extensions);
1143
1286
  return filterEnabledExtensions(logService, extensionEnablementService, extensions, ignoreWorkspaceTrust);
1144
1287
  }
@@ -1147,20 +1290,22 @@ function filterEnabledExtensions(logService, extensionEnablementService, extensi
1147
1290
  for (const extension of extensions) {
1148
1291
  if (extension.isUnderDevelopment) {
1149
1292
  enabledExtensions.push(extension);
1150
- }
1151
- else {
1293
+ } else {
1152
1294
  extensionsToCheck.push(extension);
1153
1295
  mappedExtensions.push(toExtension(extension));
1154
1296
  }
1155
1297
  }
1156
- const enablementStates = extensionEnablementService.getEnablementStates(mappedExtensions, ignoreWorkspaceTrust ? { trusted: true } : undefined);
1298
+ const enablementStates = extensionEnablementService.getEnablementStates(mappedExtensions, ignoreWorkspaceTrust ? {
1299
+ trusted: true
1300
+ } : undefined);
1157
1301
  for (let index = 0; index < enablementStates.length; index++) {
1158
1302
  if (extensionEnablementService.isEnabledEnablementState(enablementStates[index])) {
1159
1303
  enabledExtensions.push(extensionsToCheck[index]);
1160
- }
1161
- else {
1304
+ } else {
1162
1305
  if (isCI) {
1163
- logService.info(`filterEnabledExtensions: extension '${extensionsToCheck[index].identifier.value}' is disabled`);
1306
+ logService.info(
1307
+ `filterEnabledExtensions: extension '${extensionsToCheck[index].identifier.value}' is disabled`
1308
+ );
1164
1309
  }
1165
1310
  }
1166
1311
  }
@@ -1216,8 +1361,12 @@ class ExtensionHostCrashTracker {
1216
1361
  constructor() {
1217
1362
  this._recentCrashes = [];
1218
1363
  }
1219
- static { this._TIME_LIMIT = 5 * 60 * 1000; }
1220
- static { this._CRASH_LIMIT = 3; }
1364
+ static {
1365
+ this._TIME_LIMIT = 5 * 60 * 1000;
1366
+ }
1367
+ static {
1368
+ this._CRASH_LIMIT = 3;
1369
+ }
1221
1370
  _removeOldCrashes() {
1222
1371
  const limit = Date.now() - ExtensionHostCrashTracker._TIME_LIMIT;
1223
1372
  while (this._recentCrashes.length > 0 && this._recentCrashes[0].timestamp < limit) {
@@ -1226,7 +1375,9 @@ class ExtensionHostCrashTracker {
1226
1375
  }
1227
1376
  registerCrash() {
1228
1377
  this._removeOldCrashes();
1229
- this._recentCrashes.push({ timestamp: Date.now() });
1378
+ this._recentCrashes.push({
1379
+ timestamp: Date.now()
1380
+ });
1230
1381
  }
1231
1382
  shouldAutomaticallyRestart() {
1232
1383
  this._removeOldCrashes();
@@ -1241,7 +1392,7 @@ class ImplicitActivationAwareReader {
1241
1392
  class ActivationFeatureMarkdowneRenderer extends Disposable {
1242
1393
  constructor() {
1243
1394
  super(...arguments);
1244
- this.type = 'markdown';
1395
+ this.type = "markdown";
1245
1396
  }
1246
1397
  shouldRender(manifest) {
1247
1398
  return !!manifest.activationEvents;
@@ -1256,17 +1407,17 @@ class ActivationFeatureMarkdowneRenderer extends Disposable {
1256
1407
  }
1257
1408
  return {
1258
1409
  data,
1259
- dispose: () => { }
1410
+ dispose: () => {}
1260
1411
  };
1261
1412
  }
1262
1413
  }
1263
1414
  ( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
1264
- id: 'activationEvents',
1265
- label: ( localize(14006, "Activation Events")),
1415
+ id: "activationEvents",
1416
+ label: ( localize(14393, "Activation Events")),
1266
1417
  access: {
1267
1418
  canToggle: false
1268
1419
  },
1269
- renderer: ( new SyncDescriptor(ActivationFeatureMarkdowneRenderer)),
1420
+ renderer: ( new SyncDescriptor(ActivationFeatureMarkdowneRenderer))
1270
1421
  });
1271
1422
 
1272
1423
  export { AbstractExtensionService, DeltaExtensionsQueueItem, ExtensionHostCrashTracker, ExtensionStatus, ImplicitActivationAwareReader, LocalExtensions, RemoteExtensions, ResolverExtensions, checkEnabledAndProposedAPI, filterEnabledExtensions, isResolverExtension };