@codingame/monaco-vscode-update-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-update-service-override",
3
- "version": "3.2.3",
3
+ "version": "4.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,6 +18,6 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@3.2.3"
21
+ "vscode": "npm:@codingame/monaco-vscode-api@4.0.0"
22
22
  }
23
23
  }
@@ -11,7 +11,6 @@ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/te
11
11
  import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService';
12
12
 
13
13
  const codeSettingRegex = /^<code (codesetting)="([^\s"\:]+)(?::([^"]+))?">/;
14
- const codeFeatureRegex = /^<span (codefeature)="([^\s"\:]+)(?::([^"]+))?">/;
15
14
  let SimpleSettingRenderer = class SimpleSettingRenderer {
16
15
  constructor(_configurationService, _contextMenuService, _preferencesService, _telemetryService, _clipboardService) {
17
16
  this._configurationService = _configurationService;
@@ -34,10 +33,10 @@ let SimpleSettingRenderer = class SimpleSettingRenderer {
34
33
  }
35
34
  getHtmlRenderer() {
36
35
  return (html) => {
37
- const match = codeSettingRegex.exec(html) ?? codeFeatureRegex.exec(html);
36
+ const match = codeSettingRegex.exec(html);
38
37
  if (match && match.length === 4) {
39
38
  const settingId = match[2];
40
- const rendered = this.render(settingId, match[3], match[1] === 'codefeature');
39
+ const rendered = this.render(settingId, match[3]);
41
40
  if (rendered) {
42
41
  html = html.replace(codeSettingRegex, rendered);
43
42
  }
@@ -48,9 +47,6 @@ let SimpleSettingRenderer = class SimpleSettingRenderer {
48
47
  settingToUriString(settingId, value) {
49
48
  return `${Schemas.codeSetting}://${settingId}${value ? `/${value}` : ''}`;
50
49
  }
51
- featureToUriString(settingId, value) {
52
- return `${Schemas.codeFeature}://${settingId}${value ? `/${value}` : ''}`;
53
- }
54
50
  getSetting(settingId) {
55
51
  if (!this.settingsGroups) {
56
52
  this.settingsGroups = this._defaultSettings.getSettingsGroups();
@@ -88,17 +84,12 @@ let SimpleSettingRenderer = class SimpleSettingRenderer {
88
84
  return value;
89
85
  }
90
86
  }
91
- render(settingId, newValue, asFeature) {
87
+ render(settingId, newValue) {
92
88
  const setting = this.getSetting(settingId);
93
89
  if (!setting) {
94
90
  return '';
95
91
  }
96
- if (asFeature) {
97
- return this.renderFeature(setting, newValue);
98
- }
99
- else {
100
- return this.renderSetting(setting, newValue);
101
- }
92
+ return this.renderSetting(setting, newValue);
102
93
  }
103
94
  viewInSettingsMessage(settingId, alreadyDisplayed) {
104
95
  if (alreadyDisplayed) {
@@ -196,19 +187,6 @@ let SimpleSettingRenderer = class SimpleSettingRenderer {
196
187
  <span class="setting-name">${setting.key}</span>
197
188
  </a></code><code>`;
198
189
  }
199
- renderFeature(setting, newValue) {
200
- const href = this.featureToUriString(setting.key, newValue);
201
- const parsedValue = this.parseValue(setting.key, newValue);
202
- const isChecked = this._configurationService.getValue(setting.key) === parsedValue;
203
- this._featuredSettings.set(setting.key, parsedValue);
204
- const title = ( localizeWithPath(
205
- 'vs/workbench/contrib/markdown/browser/markdownSettingRenderer',
206
- 'changeFeatureTitle',
207
- "Toggle feature with setting {0}",
208
- setting.key
209
- ));
210
- return `<span><div class="codefeature-container"><input id="${setting.key}" class="hiddenCheck" type="checkbox" ${isChecked ? 'checked' : ''}><span class="codefeature"><a href="${href}" class="toggle" title="${title}" role="checkbox" aria-checked="${isChecked ? 'true' : 'false'}"></a></span><span class="title"></span></div>`;
211
- }
212
190
  getSettingMessage(setting, newValue) {
213
191
  if (setting.type === 'boolean') {
214
192
  return this.booleanSettingMessage(setting, newValue);
@@ -311,22 +289,6 @@ let SimpleSettingRenderer = class SimpleSettingRenderer {
311
289
  },
312
290
  });
313
291
  }
314
- async setFeatureState(uri) {
315
- const settingId = uri.authority;
316
- const newSettingValue = this.parseValue(uri.authority, uri.path.substring(1));
317
- let valueToSetSetting;
318
- if (( this._updatedSettings.has(settingId))) {
319
- valueToSetSetting = this._updatedSettings.get(settingId);
320
- this._updatedSettings.delete(settingId);
321
- }
322
- else if (newSettingValue !== this._configurationService.getValue(settingId)) {
323
- valueToSetSetting = newSettingValue;
324
- }
325
- else {
326
- valueToSetSetting = undefined;
327
- }
328
- await this._configurationService.updateValue(settingId, valueToSetSetting, 2 );
329
- }
330
292
  async updateSetting(uri, x, y) {
331
293
  if (uri.scheme === Schemas.codeSetting) {
332
294
  this._telemetryService.publicLog2('releaseNotesSettingAction', {
@@ -334,9 +296,6 @@ let SimpleSettingRenderer = class SimpleSettingRenderer {
334
296
  });
335
297
  return this.showContextMenu(uri, x, y);
336
298
  }
337
- else if (uri.scheme === Schemas.codeFeature) {
338
- return this.setFeatureState(uri);
339
- }
340
299
  }
341
300
  };
342
301
  SimpleSettingRenderer = ( __decorate([
@@ -58,11 +58,9 @@ let ReleaseNotesManager = class ReleaseNotesManager {
58
58
  if (!this._currentReleaseNotes || !this._lastText) {
59
59
  return;
60
60
  }
61
- const captureScroll = this.scrollPosition;
62
61
  const html = await this.renderBody(this._lastText);
63
62
  if (this._currentReleaseNotes) {
64
63
  this._currentReleaseNotes.webview.setHtml(html);
65
- this._currentReleaseNotes.webview.postMessage({ type: 'setScroll', value: { scrollPosition: captureScroll } });
66
64
  }
67
65
  }
68
66
  async show(version, useCurrentFile) {
@@ -101,9 +99,6 @@ let ReleaseNotesManager = class ReleaseNotesManager {
101
99
  if (e.message.type === 'showReleaseNotes') {
102
100
  this._configurationService.updateValue('update.showReleaseNotes', e.message.value);
103
101
  }
104
- else if (e.message.type === 'scroll') {
105
- this.scrollPosition = e.message.value.scrollPosition;
106
- }
107
102
  else if (e.message.type === 'clickSetting') {
108
103
  const x = this._currentReleaseNotes?.webview.container.offsetLeft + e.message.value.x;
109
104
  const y = this._currentReleaseNotes?.webview.container.offsetTop + e.message.value.y;
@@ -203,7 +198,7 @@ let ReleaseNotesManager = class ReleaseNotesManager {
203
198
  return this._releaseNotesCache.get(version);
204
199
  }
205
200
  async onDidClickLink(uri) {
206
- if (uri.scheme === Schemas.codeSetting || uri.scheme === Schemas.codeFeature) ;
201
+ if (uri.scheme === Schemas.codeSetting) ;
207
202
  else {
208
203
  this.addGAParameters(uri, 'ReleaseNotes')
209
204
  .then(updated => this._openerService.open(updated, { allowCommands: ['workbench.action.openSettings'] }))
@@ -318,72 +313,6 @@ let ReleaseNotesManager = class ReleaseNotesManager {
318
313
  margin-right: 8px;
319
314
  }
320
315
 
321
- /* codefeature */
322
-
323
- .codefeature-container {
324
- display: flex;
325
- }
326
-
327
- .codefeature {
328
- position: relative;
329
- display: inline-block;
330
- width: 46px;
331
- height: 24px;
332
- }
333
-
334
- .codefeature-container input {
335
- display: none;
336
- }
337
-
338
- .toggle {
339
- position: absolute;
340
- cursor: pointer;
341
- top: 0;
342
- left: 0;
343
- right: 0;
344
- bottom: 0;
345
- background-color: var(--vscode-button-background);
346
- transition: .4s;
347
- border-radius: 24px;
348
- }
349
-
350
- .toggle:before {
351
- position: absolute;
352
- content: "";
353
- height: 16px;
354
- width: 16px;
355
- left: 4px;
356
- bottom: 4px;
357
- background-color: var(--vscode-editor-foreground);
358
- transition: .4s;
359
- border-radius: 50%;
360
- }
361
-
362
- input:checked+.codefeature > .toggle:before {
363
- transform: translateX(22px);
364
- }
365
-
366
- .codefeature-container:has(input) .title {
367
- line-height: 30px;
368
- padding-left: 4px;
369
- font-weight: bold;
370
- }
371
-
372
- .codefeature-container:has(input:checked) .title:after {
373
- content: "${( localizeWithPath(
374
- 'vs/workbench/contrib/update/browser/releaseNotesEditor',
375
- 'disableFeature',
376
- "Disable this feature"
377
- ))}";
378
- }
379
- .codefeature-container:has(input:not(:checked)) .title:after {
380
- content: "${( localizeWithPath(
381
- 'vs/workbench/contrib/update/browser/releaseNotesEditor',
382
- 'enableFeature',
383
- "Enable this feature"
384
- ))}";
385
- }
386
-
387
316
  header { display: flex; align-items: center; padding-top: 1em; }
388
317
  </style>
389
318
  </head>
@@ -420,40 +349,13 @@ let ReleaseNotesManager = class ReleaseNotesManager {
420
349
  window.addEventListener('message', event => {
421
350
  if (event.data.type === 'showReleaseNotes') {
422
351
  input.checked = event.data.value;
423
- } else if (event.data.type === 'setScroll') {
424
- window.scrollTo(event.data.value.scrollPosition.x, event.data.value.scrollPosition.y);
425
- } else if (event.data.type === 'setFeaturedSettings') {
426
- for (const [settingId, value] of event.data.value) {
427
- const setting = document.getElementById(settingId);
428
- if (setting instanceof HTMLInputElement) {
429
- setting.checked = value;
430
- }
431
- }
432
352
  }
433
353
  });
434
354
 
435
- window.onscroll = () => {
436
- vscode.postMessage({
437
- type: 'scroll',
438
- value: {
439
- scrollPosition: {
440
- x: window.scrollX,
441
- y: window.scrollY
442
- }
443
- }
444
- });
445
- };
446
-
447
355
  window.addEventListener('click', event => {
448
356
  const href = event.target.href ?? event.target.parentElement.href ?? event.target.parentElement.parentElement?.href;
449
- if (href && (href.startsWith('${Schemas.codeSetting}') || href.startsWith('${Schemas.codeFeature}'))) {
357
+ if (href && (href.startsWith('${Schemas.codeSetting}'))) {
450
358
  vscode.postMessage({ type: 'clickSetting', value: { uri: href, x: event.clientX, y: event.clientY }});
451
- if (href.startsWith('${Schemas.codeFeature}')) {
452
- const featureInput = event.target.parentElement.previousSibling;
453
- if (featureInput instanceof HTMLInputElement) {
454
- featureInput.checked = !featureInput.checked;
455
- }
456
- }
457
359
  }
458
360
  });
459
361
 
@@ -481,7 +383,6 @@ let ReleaseNotesManager = class ReleaseNotesManager {
481
383
  onDidChangeActiveWebviewEditor(input) {
482
384
  if (input && input === this._currentReleaseNotes) {
483
385
  this.updateCheckboxWebview();
484
- this.updateFeaturedSettingsWebview();
485
386
  }
486
387
  }
487
388
  updateCheckboxWebview() {
@@ -492,14 +393,6 @@ let ReleaseNotesManager = class ReleaseNotesManager {
492
393
  });
493
394
  }
494
395
  }
495
- updateFeaturedSettingsWebview() {
496
- if (this._currentReleaseNotes) {
497
- this._currentReleaseNotes.webview.postMessage({
498
- type: 'setFeaturedSettings',
499
- value: this._simpleSettingRenderer.featuredSettingStates
500
- });
501
- }
502
- }
503
396
  };
504
397
  ReleaseNotesManager = ( __decorate([
505
398
  ( __param(0, IEnvironmentService)),
@@ -5,7 +5,7 @@ import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
5
5
  import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
6
6
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
7
7
  import { ProductContribution, UpdateContribution, SwitchProductQualityContribution, DOWNLOAD_URL, RELEASE_NOTES_URL, showReleaseNotesInEditor, CONTEXT_UPDATE_STATE } from './update.js';
8
- import product from 'vscode/vscode/vs/platform/product/common/product';
8
+ import product$1 from 'vscode/vscode/vs/platform/product/common/product';
9
9
  import { IUpdateService } from 'vscode/vscode/vs/platform/update/common/update';
10
10
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
11
11
  import { isWindows } from 'vscode/vscode/vs/base/common/platform';
@@ -39,7 +39,7 @@ class ShowCurrentReleaseNotesAction extends Action2 {
39
39
  "Show &&Release Notes"
40
40
  )),
41
41
  },
42
- category: { value: product.nameShort, original: product.nameShort },
42
+ category: { value: product$1.nameShort, original: product$1.nameShort },
43
43
  f1: true,
44
44
  precondition: RELEASE_NOTES_URL,
45
45
  menu: [{
@@ -114,7 +114,7 @@ class CheckForUpdateAction extends Action2 {
114
114
  'checkForUpdates',
115
115
  'Check for Updates...'
116
116
  )),
117
- category: { value: product.nameShort, original: product.nameShort },
117
+ category: { value: product$1.nameShort, original: product$1.nameShort },
118
118
  f1: true,
119
119
  precondition: ( CONTEXT_UPDATE_STATE.isEqualTo("idle" )),
120
120
  });
@@ -133,7 +133,7 @@ class DownloadUpdateAction extends Action2 {
133
133
  'downloadUpdate',
134
134
  'Download Update'
135
135
  )),
136
- category: { value: product.nameShort, original: product.nameShort },
136
+ category: { value: product$1.nameShort, original: product$1.nameShort },
137
137
  f1: true,
138
138
  precondition: ( CONTEXT_UPDATE_STATE.isEqualTo("available for download" ))
139
139
  });
@@ -151,7 +151,7 @@ class InstallUpdateAction extends Action2 {
151
151
  'installUpdate',
152
152
  'Install Update'
153
153
  )),
154
- category: { value: product.nameShort, original: product.nameShort },
154
+ category: { value: product$1.nameShort, original: product$1.nameShort },
155
155
  f1: true,
156
156
  precondition: ( CONTEXT_UPDATE_STATE.isEqualTo("downloaded" ))
157
157
  });
@@ -169,7 +169,7 @@ class RestartToUpdateAction extends Action2 {
169
169
  'restartToUpdate',
170
170
  'Restart to Update'
171
171
  )),
172
- category: { value: product.nameShort, original: product.nameShort },
172
+ category: { value: product$1.nameShort, original: product$1.nameShort },
173
173
  f1: true,
174
174
  precondition: ( CONTEXT_UPDATE_STATE.isEqualTo("ready" ))
175
175
  });
@@ -187,7 +187,7 @@ class DownloadAction extends Action2 {
187
187
  'vs/workbench/contrib/update/browser/update.contribution',
188
188
  'openDownloadPage',
189
189
  "Download {0}",
190
- product.nameLong
190
+ product$1.nameLong
191
191
  )),
192
192
  precondition: ( ContextKeyExpr.and(IsWebContext, DOWNLOAD_URL)),
193
193
  f1: true,
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
2
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import Severity from 'vscode/vscode/vs/base/common/severity';
3
+ import Severity$1 from 'vscode/vscode/vs/base/common/severity';
4
4
  import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
5
5
  import { URI } from 'vscode/vscode/vs/base/common/uri';
6
6
  import { NumberBadge, ProgressBadge, IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity';
@@ -8,11 +8,11 @@ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/c
8
8
  import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
9
9
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
10
10
  import { IUpdateService } from 'vscode/vscode/vs/platform/update/common/update';
11
- import { Severity as Severity$1, INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
11
+ import { Severity, INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
12
12
  import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
13
13
  import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/browser/environmentService';
14
14
  import { ReleaseNotesManager } from './releaseNotesEditor.js';
15
- import { isWeb, isWindows } from 'vscode/vscode/vs/base/common/platform';
15
+ import { isWeb, isMacintosh, isWindows } from 'vscode/vscode/vs/base/common/platform';
16
16
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
17
17
  import { RawContextKey, ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
18
18
  import { MenuRegistry, MenuId, registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
@@ -104,7 +104,7 @@ let ProductContribution = class ProductContribution {
104
104
  if (shouldShowReleaseNotes && !environmentService.skipReleaseNotes && releaseNotesUrl && lastVersion && currentVersion && isMajorMinorUpdate(lastVersion, currentVersion)) {
105
105
  showReleaseNotesInEditor(instantiationService, productService.version, false)
106
106
  .then(undefined, () => {
107
- notificationService.prompt(Severity.Info, ( localizeWithPath(
107
+ notificationService.prompt(Severity$1.Info, ( localizeWithPath(
108
108
  'vs/workbench/contrib/update/browser/update',
109
109
  'read the release notes',
110
110
  "Welcome to {0} v{1}! Would you like to read the Release Notes?",
@@ -139,7 +139,7 @@ ProductContribution = ProductContribution_1 = ( __decorate([
139
139
  ( __param(8, IContextKeyService))
140
140
  ], ProductContribution));
141
141
  let UpdateContribution = class UpdateContribution extends Disposable {
142
- constructor(storageService, instantiationService, notificationService, dialogService, updateService, activityService, contextKeyService, productService, openerService, hostService) {
142
+ constructor(storageService, instantiationService, notificationService, dialogService, updateService, activityService, contextKeyService, productService, openerService, configurationService, hostService) {
143
143
  super();
144
144
  this.storageService = storageService;
145
145
  this.instantiationService = instantiationService;
@@ -150,6 +150,7 @@ let UpdateContribution = class UpdateContribution extends Disposable {
150
150
  this.contextKeyService = contextKeyService;
151
151
  this.productService = productService;
152
152
  this.openerService = openerService;
153
+ this.configurationService = configurationService;
153
154
  this.hostService = hostService;
154
155
  this.badgeDisposable = this._register(( new MutableDisposable()));
155
156
  this.state = updateService.state;
@@ -171,7 +172,7 @@ let UpdateContribution = class UpdateContribution extends Disposable {
171
172
  case "disabled" :
172
173
  if (state.reason === 5 ) {
173
174
  this.notificationService.notify({
174
- severity: Severity$1.Info,
175
+ severity: Severity.Info,
175
176
  message: ( localizeWithPath(
176
177
  'vs/workbench/contrib/update/browser/update',
177
178
  'update service disabled',
@@ -204,10 +205,13 @@ let UpdateContribution = class UpdateContribution extends Disposable {
204
205
  this.onUpdateDownloaded(state.update);
205
206
  break;
206
207
  case "ready" : {
207
- const currentVersion = parseVersion(this.productService.version);
208
- const nextVersion = parseVersion(state.update.productVersion);
209
- this.majorMinorUpdateAvailableContextKey.set(Boolean(currentVersion && nextVersion && isMajorMinorUpdate(currentVersion, nextVersion)));
210
- this.onUpdateReady(state.update);
208
+ const productVersion = state.update.productVersion;
209
+ if (productVersion) {
210
+ const currentVersion = parseVersion(this.productService.version);
211
+ const nextVersion = parseVersion(productVersion);
212
+ this.majorMinorUpdateAvailableContextKey.set(Boolean(currentVersion && nextVersion && isMajorMinorUpdate(currentVersion, nextVersion)));
213
+ this.onUpdateReady(state.update);
214
+ }
211
215
  break;
212
216
  }
213
217
  }
@@ -253,7 +257,7 @@ let UpdateContribution = class UpdateContribution extends Disposable {
253
257
  }
254
258
  error = error.replace(/See https:\/\/github\.com\/Squirrel\/Squirrel\.Mac\/issues\/182 for more information/, 'This might mean the application was put on quarantine by macOS. See [this link](https://github.com/microsoft/vscode/issues/7426#issuecomment-425093469) for more information');
255
259
  this.notificationService.notify({
256
- severity: Severity$1.Error,
260
+ severity: Severity.Error,
257
261
  message: error,
258
262
  source: ( localizeWithPath(
259
263
  'vs/workbench/contrib/update/browser/update',
@@ -273,7 +277,11 @@ let UpdateContribution = class UpdateContribution extends Disposable {
273
277
  if (!this.shouldShowNotification()) {
274
278
  return;
275
279
  }
276
- this.notificationService.prompt(Severity.Info, ( localizeWithPath(
280
+ const productVersion = update.productVersion;
281
+ if (!productVersion) {
282
+ return;
283
+ }
284
+ this.notificationService.prompt(Severity$1.Info, ( localizeWithPath(
277
285
  'vs/workbench/contrib/update/browser/update',
278
286
  'thereIsUpdateAvailable',
279
287
  "There is an available update."
@@ -294,20 +302,30 @@ let UpdateContribution = class UpdateContribution extends Disposable {
294
302
  "Release Notes"
295
303
  )),
296
304
  run: () => {
297
- this.instantiationService.invokeFunction(accessor => showReleaseNotes(accessor, update.productVersion));
305
+ this.instantiationService.invokeFunction(accessor => showReleaseNotes(accessor, productVersion));
298
306
  }
299
307
  }]);
300
308
  }
301
309
  onUpdateDownloaded(update) {
310
+ if (isMacintosh) {
311
+ return;
312
+ }
313
+ if (this.configurationService.getValue('update.enableWindowsBackgroundUpdates') && this.productService.target === 'user') {
314
+ return;
315
+ }
302
316
  if (!this.shouldShowNotification()) {
303
317
  return;
304
318
  }
305
- this.notificationService.prompt(Severity.Info, ( localizeWithPath(
319
+ const productVersion = update.productVersion;
320
+ if (!productVersion) {
321
+ return;
322
+ }
323
+ this.notificationService.prompt(Severity$1.Info, ( localizeWithPath(
306
324
  'vs/workbench/contrib/update/browser/update',
307
325
  'updateAvailable',
308
326
  "There's an update available: {0} {1}",
309
327
  this.productService.nameLong,
310
- update.productVersion
328
+ productVersion
311
329
  )), [{
312
330
  label: ( localizeWithPath(
313
331
  'vs/workbench/contrib/update/browser/update',
@@ -325,7 +343,7 @@ let UpdateContribution = class UpdateContribution extends Disposable {
325
343
  "Release Notes"
326
344
  )),
327
345
  run: () => {
328
- this.instantiationService.invokeFunction(accessor => showReleaseNotes(accessor, update.productVersion));
346
+ this.instantiationService.invokeFunction(accessor => showReleaseNotes(accessor, productVersion));
329
347
  }
330
348
  }]);
331
349
  }
@@ -340,7 +358,8 @@ let UpdateContribution = class UpdateContribution extends Disposable {
340
358
  label: ( localizeWithPath('vs/workbench/contrib/update/browser/update', 'later', "Later")),
341
359
  run: () => { }
342
360
  }];
343
- if (update.productVersion) {
361
+ const productVersion = update.productVersion;
362
+ if (productVersion) {
344
363
  actions.push({
345
364
  label: ( localizeWithPath(
346
365
  'vs/workbench/contrib/update/browser/update',
@@ -348,11 +367,11 @@ let UpdateContribution = class UpdateContribution extends Disposable {
348
367
  "Release Notes"
349
368
  )),
350
369
  run: () => {
351
- this.instantiationService.invokeFunction(accessor => showReleaseNotes(accessor, update.productVersion));
370
+ this.instantiationService.invokeFunction(accessor => showReleaseNotes(accessor, productVersion));
352
371
  }
353
372
  });
354
373
  }
355
- this.notificationService.prompt(Severity.Info, ( localizeWithPath(
374
+ this.notificationService.prompt(Severity$1.Info, ( localizeWithPath(
356
375
  'vs/workbench/contrib/update/browser/update',
357
376
  'updateAvailableAfterRestart',
358
377
  "Restart {0} to apply the latest update.",
@@ -458,8 +477,10 @@ let UpdateContribution = class UpdateContribution extends Disposable {
458
477
  if (this.updateService.state.type !== "ready" ) {
459
478
  return;
460
479
  }
461
- const version = this.updateService.state.update.version;
462
- this.instantiationService.invokeFunction(accessor => showReleaseNotes(accessor, version));
480
+ const productVersion = this.updateService.state.update.productVersion;
481
+ if (productVersion) {
482
+ this.instantiationService.invokeFunction(accessor => showReleaseNotes(accessor, productVersion));
483
+ }
463
484
  });
464
485
  MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
465
486
  group: '7_update',
@@ -504,7 +525,8 @@ UpdateContribution = ( __decorate([
504
525
  ( __param(6, IContextKeyService)),
505
526
  ( __param(7, IProductService)),
506
527
  ( __param(8, IOpenerService)),
507
- ( __param(9, IHostService))
528
+ ( __param(9, IConfigurationService)),
529
+ ( __param(10, IHostService))
508
530
  ], UpdateContribution));
509
531
  let SwitchProductQualityContribution = class SwitchProductQualityContribution extends Disposable {
510
532
  constructor(productService, environmentService) {
@@ -520,7 +542,7 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
520
542
  const newQuality = quality === 'stable' ? 'insider' : 'stable';
521
543
  const commandId = `update.switchQuality.${newQuality}`;
522
544
  const isSwitchingToInsiders = newQuality === 'insider';
523
- registerAction2(class SwitchQuality extends Action2 {
545
+ this._register(registerAction2(class SwitchQuality extends Action2 {
524
546
  constructor() {
525
547
  super({
526
548
  id: commandId,
@@ -611,7 +633,7 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
611
633
  }
612
634
  async selectSettingsSyncService(dialogService) {
613
635
  const { result } = await dialogService.prompt({
614
- type: Severity$1.Info,
636
+ type: Severity.Info,
615
637
  message: ( localizeWithPath(
616
638
  'vs/workbench/contrib/update/browser/update',
617
639
  'selectSyncService.message',
@@ -644,7 +666,7 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
644
666
  });
645
667
  return result;
646
668
  }
647
- });
669
+ }));
648
670
  }
649
671
  }
650
672
  };