@codingame/monaco-vscode-update-service-override 31.0.1 → 32.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.
@@ -39,8 +39,8 @@ class ShowReleaseNotesAction extends Action2 {
39
39
  super({
40
40
  id: ShowCurrentReleaseNotesActionId,
41
41
  title: {
42
- ...( localize2(14966, "Show Release Notes")),
43
- mnemonicTitle: ( localize(14967, "Show &&Release Notes"))
42
+ ...( localize2(15272, "Show Release Notes")),
43
+ mnemonicTitle: ( localize(15273, "Show &&Release Notes"))
44
44
  },
45
45
  category: {
46
46
  value: product.nameShort,
@@ -66,7 +66,7 @@ class ShowReleaseNotesAction extends Action2 {
66
66
  await openerService.open(( URI.parse(productService.releaseNotesUrl)));
67
67
  } else {
68
68
  throw ( new Error(( localize(
69
- 14968,
69
+ 15274,
70
70
  "This version of {0} does not have release notes online",
71
71
  productService.nameLong
72
72
  ))));
@@ -79,10 +79,10 @@ class ShowCurrentReleaseNotesFromCurrentFileAction extends Action2 {
79
79
  super({
80
80
  id: ShowCurrentReleaseNotesFromCurrentFileActionId,
81
81
  title: {
82
- ...( localize2(14969, "Open Current File as Release Notes")),
83
- mnemonicTitle: ( localize(14967, "Show &&Release Notes"))
82
+ ...( localize2(15275, "Open Current File as Release Notes")),
83
+ mnemonicTitle: ( localize(15273, "Show &&Release Notes"))
84
84
  },
85
- category: ( localize2(14970, "Developer")),
85
+ category: ( localize2(15276, "Developer")),
86
86
  f1: true
87
87
  });
88
88
  }
@@ -92,7 +92,7 @@ class ShowCurrentReleaseNotesFromCurrentFileAction extends Action2 {
92
92
  try {
93
93
  await showReleaseNotesInEditor(instantiationService, productService.version, true);
94
94
  } catch (err) {
95
- throw ( new Error(( localize(14971, "Cannot open the current file as Release Notes"))));
95
+ throw ( new Error(( localize(15277, "Cannot open the current file as Release Notes"))));
96
96
  }
97
97
  }
98
98
  }
@@ -104,7 +104,7 @@ class CheckForUpdateAction extends Action2 {
104
104
  constructor() {
105
105
  super({
106
106
  id: "update.checkForUpdate",
107
- title: ( localize2(14972, "Check for Updates...")),
107
+ title: ( localize2(15278, "Check for Updates...")),
108
108
  category: {
109
109
  value: product.nameShort,
110
110
  original: product.nameShort
@@ -122,7 +122,7 @@ class DownloadUpdateAction extends Action2 {
122
122
  constructor() {
123
123
  super({
124
124
  id: "update.downloadUpdate",
125
- title: ( localize2(14973, "Download Update")),
125
+ title: ( localize2(15279, "Download Update")),
126
126
  category: {
127
127
  value: product.nameShort,
128
128
  original: product.nameShort
@@ -139,7 +139,7 @@ class InstallUpdateAction extends Action2 {
139
139
  constructor() {
140
140
  super({
141
141
  id: "update.installUpdate",
142
- title: ( localize2(14974, "Install Update")),
142
+ title: ( localize2(15280, "Install Update")),
143
143
  category: {
144
144
  value: product.nameShort,
145
145
  original: product.nameShort
@@ -156,7 +156,7 @@ class RestartToUpdateAction extends Action2 {
156
156
  constructor() {
157
157
  super({
158
158
  id: "update.restartToUpdate",
159
- title: ( localize2(14975, "Restart to Update")),
159
+ title: ( localize2(15281, "Restart to Update")),
160
160
  category: {
161
161
  value: product.nameShort,
162
162
  original: product.nameShort
@@ -179,7 +179,7 @@ class DownloadAction extends Action2 {
179
179
  constructor() {
180
180
  super({
181
181
  id: DownloadAction.ID,
182
- title: ( localize2(14976, "Download {0}", product.nameLong)),
182
+ title: ( localize2(15282, "Download {0}", product.nameLong)),
183
183
  precondition: IsWebContext,
184
184
  f1: true,
185
185
  menu: [{
@@ -208,7 +208,7 @@ if (isWindows) {
208
208
  constructor() {
209
209
  super({
210
210
  id: "_update.applyupdate",
211
- title: ( localize2(14977, "Apply Update...")),
211
+ title: ( localize2(15283, "Apply Update...")),
212
212
  category: Categories.Developer,
213
213
  f1: true,
214
214
  precondition: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle))
@@ -218,13 +218,13 @@ if (isWindows) {
218
218
  const updateService = accessor.get(IUpdateService);
219
219
  const fileDialogService = accessor.get(IFileDialogService);
220
220
  const updatePath = await fileDialogService.showOpenDialog({
221
- title: ( localize(14978, "Apply Update")),
221
+ title: ( localize(15284, "Apply Update")),
222
222
  filters: [{
223
223
  name: "Setup",
224
224
  extensions: ["exe"]
225
225
  }],
226
226
  canSelectFiles: true,
227
- openLabel: mnemonicButtonLabel(( localize(14979, "&&Update")))
227
+ openLabel: mnemonicButtonLabel(( localize(15285, "&&Update")))
228
228
  });
229
229
  if (!updatePath || !updatePath[0]) {
230
230
  return;
@@ -238,7 +238,7 @@ registerAction2(class ShowUpdateInfoAction extends Action2 {
238
238
  constructor() {
239
239
  super({
240
240
  id: "update.showUpdateInfo",
241
- title: ( localize2(14980, "Show Update Info")),
241
+ title: ( localize2(15286, "Show Update Info")),
242
242
  category: Categories.Developer,
243
243
  f1: true,
244
244
  precondition: ( IsWebContext.negate())
@@ -249,7 +249,7 @@ registerAction2(class ShowUpdateInfoAction extends Action2 {
249
249
  const quickInputService = accessor.get(IQuickInputService);
250
250
  const markdown = await quickInputService.input({
251
251
  prompt: ( localize(
252
- 14981,
252
+ 15287,
253
253
  "Enter markdown to render, or JSON with markdown/buttons (leave empty to load from URL)"
254
254
  ))
255
255
  });
@@ -6,7 +6,6 @@ import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/w
6
6
  import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
7
7
  import { IUpdateService } from "@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update.service";
8
8
  import { INotificationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service";
9
- import { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
10
9
  import { IBrowserWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/browser/environmentService.service";
11
10
  import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
12
11
  import { RawContextKey } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey";
@@ -31,18 +30,15 @@ export declare class ProductContribution implements IWorkbenchContribution {
31
30
  }
32
31
  export declare class UpdateContribution extends Disposable implements IWorkbenchContribution {
33
32
  private readonly instantiationService;
34
- private readonly dialogService;
35
33
  private readonly updateService;
36
34
  private readonly activityService;
37
35
  private readonly productService;
38
- private readonly hostService;
39
36
  private state;
40
37
  private readonly badgeDisposable;
41
38
  private updateStateContextKey;
42
39
  private majorMinorUpdateAvailableContextKey;
43
- constructor(storageService: IStorageService, instantiationService: IInstantiationService, dialogService: IDialogService, updateService: IUpdateService, activityService: IActivityService, contextKeyService: IContextKeyService, productService: IProductService, hostService: IHostService);
40
+ constructor(storageService: IStorageService, instantiationService: IInstantiationService, updateService: IUpdateService, activityService: IActivityService, contextKeyService: IContextKeyService, productService: IProductService);
44
41
  private onUpdateStateChange;
45
- private onUpdateNotAvailable;
46
42
  private registerGlobalActivityActions;
47
43
  }
48
44
  export declare class SwitchProductQualityContribution extends Disposable implements IWorkbenchContribution {
@@ -53,7 +53,7 @@ async function openLatestReleaseNotesInBrowser(accessor) {
53
53
  await openerService.open(uri);
54
54
  } else {
55
55
  throw ( new Error(( localize(
56
- 14982,
56
+ 15288,
57
57
  "This version of {0} does not have release notes online",
58
58
  productService.nameLong
59
59
  ))));
@@ -76,7 +76,7 @@ function appendUpdateMenuItems(menuId, group) {
76
76
  group,
77
77
  command: {
78
78
  id: "update.check",
79
- title: ( localize(14983, "Check for Updates..."))
79
+ title: ( localize(15289, "Check for Updates..."))
80
80
  },
81
81
  when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Idle))
82
82
  });
@@ -84,7 +84,7 @@ function appendUpdateMenuItems(menuId, group) {
84
84
  group,
85
85
  command: {
86
86
  id: "update.checking",
87
- title: ( localize(14984, "Checking for Updates...")),
87
+ title: ( localize(15290, "Checking for Updates...")),
88
88
  precondition: ( ContextKeyExpr.false())
89
89
  },
90
90
  when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.CheckingForUpdates))
@@ -93,7 +93,7 @@ function appendUpdateMenuItems(menuId, group) {
93
93
  group,
94
94
  command: {
95
95
  id: "update.downloadNow",
96
- title: ( localize(14985, "Download Update (1)"))
96
+ title: ( localize(15291, "Download Update (1)"))
97
97
  },
98
98
  when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.AvailableForDownload))
99
99
  });
@@ -101,7 +101,7 @@ function appendUpdateMenuItems(menuId, group) {
101
101
  group,
102
102
  command: {
103
103
  id: "update.downloading",
104
- title: ( localize(14986, "Downloading Update...")),
104
+ title: ( localize(15292, "Downloading Update...")),
105
105
  precondition: ( ContextKeyExpr.false())
106
106
  },
107
107
  when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Downloading))
@@ -110,7 +110,7 @@ function appendUpdateMenuItems(menuId, group) {
110
110
  group,
111
111
  command: {
112
112
  id: "update.install",
113
- title: ( localize(14987, "Install Update... (1)"))
113
+ title: ( localize(15293, "Install Update... (1)"))
114
114
  },
115
115
  when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Downloaded))
116
116
  });
@@ -118,7 +118,7 @@ function appendUpdateMenuItems(menuId, group) {
118
118
  group,
119
119
  command: {
120
120
  id: "update.updating",
121
- title: ( localize(14988, "Installing Update...")),
121
+ title: ( localize(15294, "Installing Update...")),
122
122
  precondition: ( ContextKeyExpr.false())
123
123
  },
124
124
  when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Updating))
@@ -128,7 +128,7 @@ function appendUpdateMenuItems(menuId, group) {
128
128
  order: 2,
129
129
  command: {
130
130
  id: "update.restart",
131
- title: ( localize(14989, "Restart to Update (1)"))
131
+ title: ( localize(15295, "Restart to Update (1)"))
132
132
  },
133
133
  when: ( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Ready))
134
134
  });
@@ -165,16 +165,17 @@ let ProductContribution = class ProductContribution {
165
165
  );
166
166
  const currentVersion = tryParseVersion(productService.version);
167
167
  const shouldShowReleaseNotes = configurationService.getValue("update.showReleaseNotes");
168
+ const shouldShowPostInstallInfo = configurationService.getValue("update.showPostInstallInfo");
168
169
  const releaseNotesUrl = productService.releaseNotesUrl;
169
- if (shouldShowReleaseNotes && !environmentService.skipReleaseNotes && releaseNotesUrl && lastVersion && currentVersion && isMajorMinorUpdate(lastVersion, currentVersion)) {
170
+ if (shouldShowReleaseNotes && !shouldShowPostInstallInfo && !environmentService.skipReleaseNotes && releaseNotesUrl && lastVersion && currentVersion && isMajorMinorUpdate(lastVersion, currentVersion)) {
170
171
  showReleaseNotesInEditor(instantiationService, productService.version, false).then(undefined, () => {
171
172
  notificationService.prompt(Severity.Info, ( localize(
172
- 14990,
173
+ 15296,
173
174
  "Welcome to {0} v{1}! Would you like to read the Release Notes?",
174
175
  productService.nameLong,
175
176
  productService.version
176
177
  )), [{
177
- label: ( localize(14991, "Release Notes")),
178
+ label: ( localize(15297, "Release Notes")),
178
179
  run: () => {
179
180
  const uri = ( URI.parse(releaseNotesUrl));
180
181
  openerService.open(uri);
@@ -198,20 +199,16 @@ let UpdateContribution = class UpdateContribution extends Disposable {
198
199
  constructor(
199
200
  storageService,
200
201
  instantiationService,
201
- dialogService,
202
202
  updateService,
203
203
  activityService,
204
204
  contextKeyService,
205
- productService,
206
- hostService
205
+ productService
207
206
  ) {
208
207
  super();
209
208
  this.instantiationService = instantiationService;
210
- this.dialogService = dialogService;
211
209
  this.updateService = updateService;
212
210
  this.activityService = activityService;
213
211
  this.productService = productService;
214
- this.hostService = hostService;
215
212
  this.badgeDisposable = this._register(( new MutableDisposable()));
216
213
  this.state = updateService.state;
217
214
  this.updateStateContextKey = CONTEXT_UPDATE_STATE.bindTo(contextKeyService);
@@ -229,11 +226,6 @@ let UpdateContribution = class UpdateContribution extends Disposable {
229
226
  async onUpdateStateChange(state) {
230
227
  this.updateStateContextKey.set(state.type);
231
228
  switch (state.type) {
232
- case StateType.Idle:
233
- if (this.state.type === StateType.CheckingForUpdates && this.state.explicit && !state.error && (await this.hostService.hadLastFocus())) {
234
- this.onUpdateNotAvailable();
235
- }
236
- break;
237
229
  case StateType.Ready:
238
230
  {
239
231
  const productVersion = state.update.productVersion;
@@ -249,13 +241,13 @@ let UpdateContribution = class UpdateContribution extends Disposable {
249
241
  }
250
242
  let badge = undefined;
251
243
  if (state.type === StateType.AvailableForDownload || state.type === StateType.Downloaded || state.type === StateType.Ready) {
252
- badge = ( new NumberBadge(1, () => ( localize(14992, "New {0} update available.", this.productService.nameShort))));
244
+ badge = ( new NumberBadge(1, () => ( localize(15298, "New {0} update available.", this.productService.nameShort))));
253
245
  } else if (state.type === StateType.CheckingForUpdates) {
254
- badge = ( new ProgressBadge(() => ( localize(14993, "Checking for {0} updates...", this.productService.nameShort))));
246
+ badge = ( new ProgressBadge(() => ( localize(15299, "Checking for {0} updates...", this.productService.nameShort))));
255
247
  } else if (state.type === StateType.Downloading || state.type === StateType.Overwriting) {
256
- badge = ( new ProgressBadge(() => ( localize(14994, "Downloading {0} update...", this.productService.nameShort))));
248
+ badge = ( new ProgressBadge(() => ( localize(15300, "Downloading {0} update...", this.productService.nameShort))));
257
249
  } else if (state.type === StateType.Updating) {
258
- badge = ( new ProgressBadge(() => ( localize(14995, "Updating {0}...", this.productService.nameShort))));
250
+ badge = ( new ProgressBadge(() => ( localize(15301, "Updating {0}...", this.productService.nameShort))));
259
251
  }
260
252
  this.badgeDisposable.clear();
261
253
  if (badge) {
@@ -265,9 +257,6 @@ let UpdateContribution = class UpdateContribution extends Disposable {
265
257
  }
266
258
  this.state = state;
267
259
  }
268
- onUpdateNotAvailable() {
269
- this.dialogService.info(( localize(14996, "There are currently no updates available.")));
270
- }
271
260
  registerGlobalActivityActions() {
272
261
  CommandsRegistry.registerCommand("update.check", () => this.updateService.checkForUpdates(true));
273
262
  CommandsRegistry.registerCommand("update.checking", () => {});
@@ -295,14 +284,14 @@ let UpdateContribution = class UpdateContribution extends Disposable {
295
284
  order: 1,
296
285
  command: {
297
286
  id: "update.showUpdateReleaseNotes",
298
- title: ( localize(14997, "Show Update Release Notes"))
287
+ title: ( localize(15302, "Show Update Release Notes"))
299
288
  },
300
289
  when: ( ContextKeyExpr.and(( CONTEXT_UPDATE_STATE.isEqualTo(StateType.Ready)), MAJOR_MINOR_UPDATE_AVAILABLE))
301
290
  });
302
291
  }
303
292
  }
304
293
  };
305
- UpdateContribution = ( __decorate([( __param(0, IStorageService)), ( __param(1, IInstantiationService)), ( __param(2, IDialogService)), ( __param(3, IUpdateService)), ( __param(4, IActivityService)), ( __param(5, IContextKeyService)), ( __param(6, IProductService)), ( __param(7, IHostService))], UpdateContribution));
294
+ UpdateContribution = ( __decorate([( __param(0, IStorageService)), ( __param(1, IInstantiationService)), ( __param(2, IUpdateService)), ( __param(3, IActivityService)), ( __param(4, IContextKeyService)), ( __param(5, IProductService))], UpdateContribution));
306
295
  let SwitchProductQualityContribution = class SwitchProductQualityContribution extends Disposable {
307
296
  constructor(productService, environmentService) {
308
297
  super();
@@ -321,7 +310,7 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
321
310
  constructor() {
322
311
  super({
323
312
  id: commandId,
324
- title: isSwitchingToInsiders ? ( localize(14998, "Switch to Insiders Version...")) : ( localize(14999, "Switch to Stable Version...")),
313
+ title: isSwitchingToInsiders ? ( localize(15303, "Switch to Insiders Version...")) : ( localize(15304, "Switch to Stable Version...")),
325
314
  precondition: IsWebContext,
326
315
  menu: {
327
316
  id: MenuId.GlobalActivity,
@@ -359,15 +348,15 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
359
348
  }
360
349
  const res = await dialogService.confirm({
361
350
  type: "info",
362
- message: ( localize(15000, "Changing the version requires a reload to take effect")),
351
+ message: ( localize(15305, "Changing the version requires a reload to take effect")),
363
352
  detail: newQuality === "insider" ? ( localize(
364
- 15001,
353
+ 15306,
365
354
  "Press the reload button to switch to the Insiders version of VS Code."
366
355
  )) : ( localize(
367
- 15002,
356
+ 15307,
368
357
  "Press the reload button to switch to the Stable version of VS Code."
369
358
  )),
370
- primaryButton: ( localize(15003, "&&Reload"))
359
+ primaryButton: ( localize(15308, "&&Reload"))
371
360
  });
372
361
  if (res.confirmed) {
373
362
  const promises = [];
@@ -397,18 +386,18 @@ let SwitchProductQualityContribution = class SwitchProductQualityContribution ex
397
386
  } = await dialogService.prompt({
398
387
  type: Severity.Info,
399
388
  message: ( localize(
400
- 15004,
389
+ 15309,
401
390
  "Choose the settings sync service to use after changing the version"
402
391
  )),
403
392
  detail: ( localize(
404
- 15005,
393
+ 15310,
405
394
  "The Insiders version of VS Code will synchronize your settings, keybindings, extensions, snippets and UI State using separate insiders settings sync service by default."
406
395
  )),
407
396
  buttons: [{
408
- label: ( localize(15006, "&&Insiders")),
397
+ label: ( localize(15311, "&&Insiders")),
409
398
  run: () => "insiders"
410
399
  }, {
411
- label: ( localize(15007, "&&Stable (current)")),
400
+ label: ( localize(15312, "&&Stable (current)")),
412
401
  run: () => "stable"
413
402
  }],
414
403
  cancelButton: true
@@ -3,9 +3,11 @@ import { IManagedHoverContent } from "@codingame/monaco-vscode-api/vscode/vs/bas
3
3
  import { IAction } from "@codingame/monaco-vscode-api/vscode/vs/base/common/actions";
4
4
  import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
5
5
  import { IActionViewItemService } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/actionViewItemService.service";
6
+ import { IMenuItem, MenuId } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions";
6
7
  import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
7
8
  import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
8
9
  import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service";
10
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
9
11
  import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
10
12
  import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
11
13
  import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
@@ -14,11 +16,13 @@ import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/w
14
16
  import { IHostService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service";
15
17
  import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
16
18
  import { UpdateTooltip } from "./updateTooltip.js";
19
+ export declare function registerUpdateTitleBarMenuPlacement(menuId: MenuId, item?: Omit<IMenuItem, "command">): void;
17
20
  /**
18
21
  * Displays update status and actions in the title bar.
19
22
  */
20
23
  export declare class UpdateTitleBarContribution extends Disposable implements IWorkbenchContribution {
21
24
  private readonly chatService;
25
+ private readonly configurationService;
22
26
  private readonly hostService;
23
27
  private readonly storageService;
24
28
  private readonly context;
@@ -27,7 +31,8 @@ export declare class UpdateTitleBarContribution extends Disposable implements IW
27
31
  private entry;
28
32
  private tooltipVisible;
29
33
  private readonly pendingShow;
30
- constructor(actionViewItemService: IActionViewItemService, chatService: IChatService, contextKeyService: IContextKeyService, hostService: IHostService, instantiationService: IInstantiationService, storageService: IStorageService, updateService: IUpdateService);
34
+ constructor(actionViewItemService: IActionViewItemService, chatService: IChatService, configurationService: IConfigurationService, contextKeyService: IContextKeyService, hostService: IHostService, instantiationService: IInstantiationService, storageService: IStorageService, updateService: IUpdateService);
35
+ private createEntry;
31
36
  private onStateChange;
32
37
  private setContextWhenChatIdle;
33
38
  }
@@ -10,15 +10,17 @@ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
10
10
  import { IActionViewItemService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/actionViewItemService.service';
11
11
  import { registerAction2, Action2, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
12
12
  import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
13
- import { RawContextKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
13
+ import { RawContextKey, ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
14
14
  import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
15
15
  import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
16
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
16
17
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
17
18
  import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
18
19
  import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
19
20
  import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
20
21
  import { StateType, DisablementReason } from '@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update';
21
22
  import { IUpdateService } from '@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update.service';
23
+ import { InEditorZenModeContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
22
24
  import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service';
23
25
  import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
24
26
  import { computeProgressPercent } from '../common/updateUtils.js';
@@ -32,6 +34,7 @@ const UPDATE_TITLE_BAR_ACTION_ID = "workbench.actions.updateIndicator";
32
34
  const UPDATE_TITLE_BAR_CONTEXT = ( new RawContextKey("updateTitleBar", false));
33
35
  const DISABLED_REMINDER_LAST_SHOWN_KEY = "update/disabledReminderLastShown";
34
36
  const DISABLED_REMINDER_PERIOD = 30 * 24 * 60 * 60 * 1000;
37
+ const UPDATE_TITLE_BAR_SETTING = "update.titleBar";
35
38
  const ACTIONABLE_STATES = [StateType.AvailableForDownload, StateType.Downloaded, StateType.Ready];
36
39
  const DETAILED_STATES = [
37
40
  ...ACTIONABLE_STATES,
@@ -44,12 +47,12 @@ registerAction2(class UpdateIndicatorTitleBarAction extends Action2 {
44
47
  constructor() {
45
48
  super({
46
49
  id: UPDATE_TITLE_BAR_ACTION_ID,
47
- title: ( localize(15008, "Update")),
50
+ title: ( localize(15313, "Update")),
48
51
  f1: false,
49
52
  menu: [{
50
53
  id: MenuId.TitleBarAdjacentCenter,
51
54
  order: 0,
52
- when: UPDATE_TITLE_BAR_CONTEXT
55
+ when: ( ContextKeyExpr.and(UPDATE_TITLE_BAR_CONTEXT, ( InEditorZenModeContext.negate()), ContextKeyExpr.not("inDebugMode")))
53
56
  }]
54
57
  });
55
58
  }
@@ -59,6 +62,7 @@ let UpdateTitleBarContribution = class UpdateTitleBarContribution extends Dispos
59
62
  constructor(
60
63
  actionViewItemService,
61
64
  chatService,
65
+ configurationService,
62
66
  contextKeyService,
63
67
  hostService,
64
68
  instantiationService,
@@ -67,6 +71,7 @@ let UpdateTitleBarContribution = class UpdateTitleBarContribution extends Dispos
67
71
  ) {
68
72
  super();
69
73
  this.chatService = chatService;
74
+ this.configurationService = configurationService;
70
75
  this.hostService = hostService;
71
76
  this.storageService = storageService;
72
77
  this.tooltipVisible = false;
@@ -81,26 +86,36 @@ let UpdateTitleBarContribution = class UpdateTitleBarContribution extends Dispos
81
86
  this.state = state;
82
87
  this.onStateChange();
83
88
  }));
89
+ this._register(this.configurationService.onDidChangeConfiguration(e => {
90
+ if (e.affectsConfiguration(UPDATE_TITLE_BAR_SETTING)) {
91
+ this.onStateChange();
92
+ }
93
+ }));
84
94
  this._register(actionViewItemService.register(
85
95
  MenuId.TitleBarAdjacentCenter,
86
96
  UPDATE_TITLE_BAR_ACTION_ID,
87
- (action, options) => {
88
- this.entry = instantiationService.createInstance(UpdateTitleBarEntry, action, options, this.tooltip, () => {
89
- this.tooltipVisible = false;
90
- if (!ACTIONABLE_STATES.includes(this.state.type) && !DETAILED_STATES.includes(this.state.type)) {
91
- this.context.set(false);
92
- }
93
- });
94
- if (this.tooltipVisible) {
95
- this.entry.showTooltip();
96
- }
97
- return this.entry;
98
- }
97
+ (action, options) => this.createEntry(instantiationService, action, options)
99
98
  ));
100
99
  void this.onStateChange(true);
101
100
  }
101
+ createEntry(instantiationService, action, options) {
102
+ this.entry = instantiationService.createInstance(UpdateTitleBarEntry, action, options, this.tooltip, () => {
103
+ this.tooltipVisible = false;
104
+ if (!ACTIONABLE_STATES.includes(this.state.type) && !DETAILED_STATES.includes(this.state.type)) {
105
+ this.context.set(false);
106
+ }
107
+ });
108
+ if (this.tooltipVisible) {
109
+ this.entry.showTooltip();
110
+ }
111
+ return this.entry;
112
+ }
102
113
  async onStateChange(startup = false) {
103
114
  this.pendingShow.clear();
115
+ if (this.configurationService.getValue(UPDATE_TITLE_BAR_SETTING) === false) {
116
+ this.context.set(false);
117
+ return;
118
+ }
104
119
  if (ACTIONABLE_STATES.includes(this.state.type)) {
105
120
  await this.setContextWhenChatIdle(true);
106
121
  } else {
@@ -166,7 +181,7 @@ let UpdateTitleBarContribution = class UpdateTitleBarContribution extends Dispos
166
181
  } catch {}
167
182
  }
168
183
  };
169
- UpdateTitleBarContribution = ( __decorate([( __param(0, IActionViewItemService)), ( __param(1, IChatService)), ( __param(2, IContextKeyService)), ( __param(3, IHostService)), ( __param(4, IInstantiationService)), ( __param(5, IStorageService)), ( __param(6, IUpdateService))], UpdateTitleBarContribution));
184
+ UpdateTitleBarContribution = ( __decorate([( __param(0, IActionViewItemService)), ( __param(1, IChatService)), ( __param(2, IConfigurationService)), ( __param(3, IContextKeyService)), ( __param(4, IHostService)), ( __param(5, IInstantiationService)), ( __param(6, IStorageService)), ( __param(7, IUpdateService))], UpdateTitleBarContribution));
170
185
  let UpdateTitleBarEntry = class UpdateTitleBarEntry extends BaseActionViewItem {
171
186
  constructor(
172
187
  action,
@@ -258,43 +273,43 @@ let UpdateTitleBarEntry = class UpdateTitleBarEntry extends BaseActionViewItem {
258
273
  const label = append(this.content, $(".indicator-label"));
259
274
  switch (state.type) {
260
275
  case StateType.Disabled:
261
- label.textContent = ( localize(15009, "Update"));
276
+ label.textContent = ( localize(15314, "Update"));
262
277
  this.content.classList.add("update-disabled");
263
278
  break;
264
279
  case StateType.CheckingForUpdates:
265
- label.textContent = ( localize(15010, "Checking..."));
280
+ label.textContent = ( localize(15315, "Checking..."));
266
281
  this.renderProgressState(this.content);
267
282
  break;
268
283
  case StateType.Overwriting:
269
- label.textContent = ( localize(15011, "Updating..."));
284
+ label.textContent = ( localize(15316, "Updating..."));
270
285
  this.renderProgressState(this.content);
271
286
  break;
272
287
  case StateType.AvailableForDownload:
273
288
  case StateType.Downloaded:
274
289
  case StateType.Ready:
275
- label.textContent = ( localize(15009, "Update"));
290
+ label.textContent = ( localize(15314, "Update"));
276
291
  this.content.classList.add("prominent");
277
292
  break;
278
293
  case StateType.Downloading:
279
- label.textContent = ( localize(15012, "Downloading..."));
294
+ label.textContent = ( localize(15317, "Downloading..."));
280
295
  this.renderProgressState(
281
296
  this.content,
282
297
  computeProgressPercent(state.downloadedBytes, state.totalBytes)
283
298
  );
284
299
  break;
285
300
  case StateType.Updating:
286
- label.textContent = ( localize(15013, "Installing..."));
301
+ label.textContent = ( localize(15318, "Installing..."));
287
302
  this.renderProgressState(
288
303
  this.content,
289
304
  computeProgressPercent(state.currentProgress, state.maxProgress)
290
305
  );
291
306
  break;
292
307
  case StateType.Restarting:
293
- label.textContent = ( localize(15014, "Restarting..."));
308
+ label.textContent = ( localize(15319, "Restarting..."));
294
309
  this.renderProgressState(this.content);
295
310
  break;
296
311
  default:
297
- label.textContent = ( localize(15009, "Update"));
312
+ label.textContent = ( localize(15314, "Update"));
298
313
  break;
299
314
  }
300
315
  }