@codingame/monaco-vscode-relauncher-service-override 10.1.4 → 11.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-relauncher-service-override",
3
- "version": "10.1.4",
3
+ "version": "11.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,6 +26,6 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@10.1.4"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@11.0.0"
30
30
  }
31
31
  }
@@ -13,6 +13,8 @@ import { isNative, isMacintosh, isLinux } from 'vscode/vscode/vs/base/common/pla
13
13
  import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
14
14
  import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
15
15
  import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
16
+ import { IUserDataSyncService, IUserDataSyncEnablementService } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync.service';
17
+ import { IUserDataSyncWorkbenchService } from 'vscode/vscode/vs/workbench/services/userDataSync/common/userDataSync.service';
16
18
 
17
19
  var SettingsChangeRelauncher_1;
18
20
  let SettingsChangeRelauncher = class SettingsChangeRelauncher extends Disposable {
@@ -31,10 +33,12 @@ let SettingsChangeRelauncher = class SettingsChangeRelauncher extends Disposable
31
33
  'security.restrictUNCAccess',
32
34
  'accessibility.verbosity.debug'
33
35
  ]; }
34
- constructor(hostService, configurationService, productService, dialogService) {
36
+ constructor(hostService, configurationService, userDataSyncService, userDataSyncEnablementService, userDataSyncWorkbenchService, productService, dialogService) {
35
37
  super();
36
38
  this.hostService = hostService;
37
39
  this.configurationService = configurationService;
40
+ this.userDataSyncService = userDataSyncService;
41
+ this.userDataSyncEnablementService = userDataSyncEnablementService;
38
42
  this.productService = productService;
39
43
  this.dialogService = dialogService;
40
44
  this.titleBarStyle = ( (new ChangeObserver('string')));
@@ -48,13 +52,23 @@ let SettingsChangeRelauncher = class SettingsChangeRelauncher extends Disposable
48
52
  this.enablePPEExtensionsGallery = ( (new ChangeObserver('boolean')));
49
53
  this.restrictUNCAccess = ( (new ChangeObserver('boolean')));
50
54
  this.accessibilityVerbosityDebug = ( (new ChangeObserver('boolean')));
51
- this.onConfigurationChange(undefined);
55
+ this.update(false);
52
56
  this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationChange(e)));
57
+ this._register(userDataSyncWorkbenchService.onDidTurnOnSync(e => this.update(true)));
53
58
  }
54
59
  onConfigurationChange(e) {
55
60
  if (e && !( (SettingsChangeRelauncher_1.SETTINGS.some(key => e.affectsConfiguration(key))))) {
56
61
  return;
57
62
  }
63
+ if (this.isTurningOnSyncInProgress()) {
64
+ return;
65
+ }
66
+ this.update(e.source !== 7 );
67
+ }
68
+ isTurningOnSyncInProgress() {
69
+ return !this.userDataSyncEnablementService.isEnabled() && this.userDataSyncService.status === "syncing" ;
70
+ }
71
+ update(askToRelaunch) {
58
72
  let changed = false;
59
73
  function processChanged(didChange) {
60
74
  changed = changed || didChange;
@@ -79,38 +93,39 @@ let SettingsChangeRelauncher = class SettingsChangeRelauncher extends Disposable
79
93
  }
80
94
  processChanged(this.experimentsEnabled.handleChange(config.workbench?.enableExperiments));
81
95
  processChanged(this.productService.quality !== 'stable' && this.enablePPEExtensionsGallery.handleChange(config._extensionsGallery?.enablePPE));
82
- if (changed && e && e.source !== 7 ) {
96
+ if (askToRelaunch && changed && this.hostService.hasFocus) {
83
97
  this.doConfirm(isNative ?
84
- ( localize(2711, "A setting has changed that requires a restart to take effect.")) :
85
- ( localize(2712, "A setting has changed that requires a reload to take effect.")), isNative ?
98
+ ( localize(2231, "A setting has changed that requires a restart to take effect.")) :
99
+ ( localize(2232, "A setting has changed that requires a reload to take effect.")), isNative ?
86
100
  ( localize(
87
- 2713,
101
+ 2233,
88
102
  "Press the restart button to restart {0} and enable the setting.",
89
103
  this.productService.nameLong
90
104
  )) :
91
105
  ( localize(
92
- 2714,
106
+ 2234,
93
107
  "Press the reload button to reload {0} and enable the setting.",
94
108
  this.productService.nameLong
95
109
  )), isNative ?
96
- ( localize(2715, "&&Restart")) :
97
- ( localize(2716, "&&Reload")), () => this.hostService.restart());
110
+ ( localize(2235, "&&Restart")) :
111
+ ( localize(2236, "&&Reload")), () => this.hostService.restart());
98
112
  }
99
113
  }
100
114
  async doConfirm(message, detail, primaryButton, confirmedFn) {
101
- if (this.hostService.hasFocus) {
102
- const { confirmed } = await this.dialogService.confirm({ message, detail, primaryButton });
103
- if (confirmed) {
104
- confirmedFn();
105
- }
115
+ const { confirmed } = await this.dialogService.confirm({ message, detail, primaryButton });
116
+ if (confirmed) {
117
+ confirmedFn();
106
118
  }
107
119
  }
108
120
  };
109
121
  SettingsChangeRelauncher = SettingsChangeRelauncher_1 = ( (__decorate([
110
122
  ( (__param(0, IHostService))),
111
123
  ( (__param(1, IConfigurationService))),
112
- ( (__param(2, IProductService))),
113
- ( (__param(3, IDialogService)))
124
+ ( (__param(2, IUserDataSyncService))),
125
+ ( (__param(3, IUserDataSyncEnablementService))),
126
+ ( (__param(4, IUserDataSyncWorkbenchService))),
127
+ ( (__param(5, IProductService))),
128
+ ( (__param(6, IDialogService)))
114
129
  ], SettingsChangeRelauncher)));
115
130
  class ChangeObserver {
116
131
  static create(typeName) {
@@ -142,7 +157,7 @@ let WorkspaceChangeExtHostRelauncher = class WorkspaceChangeExtHostRelauncher ex
142
157
  hostService.reload();
143
158
  }
144
159
  else if (isNative) {
145
- const stopped = await extensionService.stopExtensionHosts(( localize(2717, "Restarting extension host due to a workspace folder change.")));
160
+ const stopped = await extensionService.stopExtensionHosts(( localize(2237, "Restarting extension host due to a workspace folder change.")));
146
161
  if (stopped) {
147
162
  extensionService.startExtensionHosts();
148
163
  }