@codingame/monaco-vscode-update-service-override 5.2.0 → 5.3.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-update-service-override",
3
- "version": "5.2.0",
3
+ "version": "5.3.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@5.2.0"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@5.3.0"
30
30
  }
31
31
  }
package/update.js CHANGED
@@ -1,7 +1,12 @@
1
+ import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
2
+ import { IUpdateService } from 'vscode/vscode/vs/platform/update/common/update.service';
3
+ import { BrowserUpdateService } from './vscode/src/vs/workbench/services/update/browser/updateService.js';
1
4
  import './vscode/src/vs/workbench/contrib/update/browser/update.contribution.js';
2
5
 
3
6
  function getServiceOverride() {
4
- return {};
7
+ return {
8
+ [( IUpdateService.toString())]: new SyncDescriptor(BrowserUpdateService, [], true)
9
+ };
5
10
  }
6
11
 
7
12
  export { getServiceOverride as default };
@@ -0,0 +1,65 @@
1
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
+ import { Emitter } from 'vscode/vscode/vs/base/common/event';
3
+ import { State } from 'vscode/vscode/vs/platform/update/common/update';
4
+ import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
5
+ import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/browser/environmentService.service';
6
+ import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host.service';
7
+ import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
8
+
9
+ let BrowserUpdateService = class BrowserUpdateService extends Disposable {
10
+ get state() { return this._state; }
11
+ set state(state) {
12
+ this._state = state;
13
+ this._onStateChange.fire(state);
14
+ }
15
+ constructor(environmentService, hostService) {
16
+ super();
17
+ this.environmentService = environmentService;
18
+ this.hostService = hostService;
19
+ this._onStateChange = this._register(( new Emitter()));
20
+ this.onStateChange = this._onStateChange.event;
21
+ this._state = State.Uninitialized;
22
+ this.checkForUpdates(false);
23
+ }
24
+ async isLatestVersion() {
25
+ const update = await this.doCheckForUpdates(false);
26
+ if (update === undefined) {
27
+ return undefined;
28
+ }
29
+ return !!update;
30
+ }
31
+ async checkForUpdates(explicit) {
32
+ await this.doCheckForUpdates(explicit);
33
+ }
34
+ async doCheckForUpdates(explicit) {
35
+ if (this.environmentService.options && this.environmentService.options.updateProvider) {
36
+ const updateProvider = this.environmentService.options.updateProvider;
37
+ this.state = State.CheckingForUpdates(explicit);
38
+ const update = await updateProvider.checkForUpdate();
39
+ if (update) {
40
+ this.state = State.Ready({ version: update.version, productVersion: update.version });
41
+ }
42
+ else {
43
+ this.state = State.Idle(1 );
44
+ }
45
+ return update;
46
+ }
47
+ return undefined;
48
+ }
49
+ async downloadUpdate() {
50
+ }
51
+ async applyUpdate() {
52
+ this.hostService.reload();
53
+ }
54
+ async quitAndInstall() {
55
+ this.hostService.reload();
56
+ }
57
+ async _applySpecificUpdate(packagePath) {
58
+ }
59
+ };
60
+ BrowserUpdateService = ( __decorate([
61
+ ( __param(0, IBrowserWorkbenchEnvironmentService)),
62
+ ( __param(1, IHostService))
63
+ ], BrowserUpdateService));
64
+
65
+ export { BrowserUpdateService };