@codingame/monaco-vscode-base-service-override 6.0.3 → 7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-base-service-override",
3
- "version": "6.0.3",
3
+ "version": "7.0.1",
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@6.0.3"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@7.0.1"
30
30
  }
31
31
  }
@@ -198,17 +198,17 @@ function getColor(color) {
198
198
  }
199
199
  let DecorationsService = class DecorationsService {
200
200
  constructor(uriIdentityService, themeService) {
201
- this._onDidChangeDecorationsDelayed = ( (new DebounceEmitter({ merge: all => all.flat() })));
202
- this._onDidChangeDecorations = ( (new Emitter()));
201
+ this._store = ( (new DisposableStore()));
202
+ this._onDidChangeDecorationsDelayed = this._store.add(( (new DebounceEmitter({ merge: all => all.flat() }))));
203
+ this._onDidChangeDecorations = this._store.add(( (new Emitter())));
203
204
  this.onDidChangeDecorations = this._onDidChangeDecorations.event;
204
205
  this._provider = ( (new LinkedList()));
205
206
  this._decorationStyles = ( (new DecorationStyles(themeService)));
206
207
  this._data = TernarySearchTree.forUris(key => uriIdentityService.extUri.ignorePathCasing(key));
207
- this._onDidChangeDecorationsDelayed.event(event => { this._onDidChangeDecorations.fire(( (new FileDecorationChangeEvent(event)))); });
208
+ this._store.add(this._onDidChangeDecorationsDelayed.event(event => { this._onDidChangeDecorations.fire(( (new FileDecorationChangeEvent(event)))); }));
208
209
  }
209
210
  dispose() {
210
- this._onDidChangeDecorations.dispose();
211
- this._onDidChangeDecorationsDelayed.dispose();
211
+ this._store.dispose();
212
212
  this._data.clear();
213
213
  }
214
214
  registerDecorationsProvider(provider) {
@@ -1,19 +1,13 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
2
  import { raceCancellation } from 'vscode/vscode/vs/base/common/async';
4
- import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
5
3
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
6
- import { ProgressLocation } from 'vscode/vscode/vs/platform/progress/common/progress';
7
- import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress.service';
8
4
  import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
9
5
  import { insert } from 'vscode/vscode/vs/base/common/arrays';
10
6
 
11
- const _moduleId = "vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant";
12
7
  let StoredFileWorkingCopySaveParticipant = class StoredFileWorkingCopySaveParticipant extends Disposable {
13
8
  get length() { return this.saveParticipants.length; }
14
- constructor(progressService, logService) {
9
+ constructor(logService) {
15
10
  super();
16
- this.progressService = progressService;
17
11
  this.logService = logService;
18
12
  this.saveParticipants = [];
19
13
  }
@@ -21,41 +15,29 @@ let StoredFileWorkingCopySaveParticipant = class StoredFileWorkingCopySavePartic
21
15
  const remove = insert(this.saveParticipants, participant);
22
16
  return toDisposable(() => remove());
23
17
  }
24
- participate(workingCopy, context, token) {
25
- const cts = ( (new CancellationTokenSource(token)));
26
- return this.progressService.withProgress({
27
- title: ( localizeWithPath(_moduleId, 0, "Saving '{0}'", workingCopy.name)),
28
- location: ProgressLocation.Notification,
29
- cancellable: true,
30
- delay: workingCopy.isDirty() ? 3000 : 5000
31
- }, async (progress) => {
32
- workingCopy.model?.pushStackElement();
33
- for (const saveParticipant of this.saveParticipants) {
34
- if (cts.token.isCancellationRequested || workingCopy.isDisposed()) {
35
- break;
36
- }
37
- try {
38
- const promise = saveParticipant.participate(workingCopy, context, progress, cts.token);
39
- await raceCancellation(promise, cts.token);
40
- }
41
- catch (err) {
42
- this.logService.warn(err);
43
- }
18
+ async participate(workingCopy, context, progress, token) {
19
+ workingCopy.model?.pushStackElement();
20
+ for (const saveParticipant of this.saveParticipants) {
21
+ if (token.isCancellationRequested || workingCopy.isDisposed()) {
22
+ break;
44
23
  }
45
- workingCopy.model?.pushStackElement();
46
- cts.dispose();
47
- }, () => {
48
- cts.dispose(true);
49
- });
24
+ try {
25
+ const promise = saveParticipant.participate(workingCopy, context, progress, token);
26
+ await raceCancellation(promise, token);
27
+ }
28
+ catch (err) {
29
+ this.logService.warn(err);
30
+ }
31
+ }
32
+ workingCopy.model?.pushStackElement();
50
33
  }
51
34
  dispose() {
52
35
  this.saveParticipants.splice(0, this.saveParticipants.length);
53
36
  super.dispose();
54
37
  }
55
38
  };
56
- StoredFileWorkingCopySaveParticipant = ( (__decorate([
57
- ( (__param(0, IProgressService))),
58
- ( (__param(1, ILogService)))
59
- ], StoredFileWorkingCopySaveParticipant)));
39
+ StoredFileWorkingCopySaveParticipant = ( __decorate([
40
+ ( __param(0, ILogService))
41
+ ], StoredFileWorkingCopySaveParticipant));
60
42
 
61
43
  export { StoredFileWorkingCopySaveParticipant };
@@ -155,8 +155,8 @@ let WorkingCopyFileService = class WorkingCopyFileService extends Disposable {
155
155
  addSaveParticipant(participant) {
156
156
  return this.saveParticipants.addSaveParticipant(participant);
157
157
  }
158
- runSaveParticipants(workingCopy, context, token) {
159
- return this.saveParticipants.participate(workingCopy, context, token);
158
+ runSaveParticipants(workingCopy, context, progress, token) {
159
+ return this.saveParticipants.participate(workingCopy, context, progress, token);
160
160
  }
161
161
  registerWorkingCopyProvider(provider) {
162
162
  const remove = insert(this.workingCopyProviders, provider);