@codingame/monaco-vscode-base-service-override 25.1.2 → 26.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.
Files changed (22) hide show
  1. package/index.js +4 -1
  2. package/package.json +2 -2
  3. package/vscode/src/vs/base/common/observableInternal/experimental/time.js +3 -5
  4. package/vscode/src/vs/base/parts/request/common/requestImpl.js +25 -29
  5. package/vscode/src/vs/platform/download/common/downloadService.js +6 -7
  6. package/vscode/src/vs/platform/request/common/requestIpc.js +9 -6
  7. package/vscode/src/vs/workbench/contrib/inlineCompletions/browser/renameSymbolTrackerService.d.ts +18 -0
  8. package/vscode/src/vs/workbench/contrib/inlineCompletions/browser/renameSymbolTrackerService.js +240 -0
  9. package/vscode/src/vs/workbench/services/configuration/common/jsonEditingService.js +37 -23
  10. package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +64 -45
  11. package/vscode/src/vs/workbench/services/inlineCompletions/common/inlineCompletionsUnification.js +39 -29
  12. package/vscode/src/vs/workbench/services/label/common/labelService.js +139 -111
  13. package/vscode/src/vs/workbench/services/path/browser/pathService.js +1 -1
  14. package/vscode/src/vs/workbench/services/path/common/pathService.js +12 -19
  15. package/vscode/src/vs/workbench/services/request/browser/requestService.js +16 -14
  16. package/vscode/src/vs/workbench/services/url/browser/urlService.js +9 -9
  17. package/vscode/src/vs/workbench/services/userActivity/common/userActivityRegistry.js +1 -1
  18. package/vscode/src/vs/workbench/services/userActivity/common/userActivityService.js +4 -4
  19. package/vscode/src/vs/workbench/services/userAttention/browser/userAttentionBrowser.js +32 -19
  20. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +9 -12
  21. package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyFileOperationParticipant.js +4 -8
  22. package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyFileService.js +100 -41
@@ -24,7 +24,11 @@ let UserAttentionService = class UserAttentionService extends Disposable {
24
24
  const hostAdapter = this._register(instantiationService.createInstance(UserAttentionServiceEnv));
25
25
  this.isVsCodeFocused = hostAdapter.isVsCodeFocused;
26
26
  this.isUserActive = hostAdapter.isUserActive;
27
- this._isTracingEnabled = observableFromEvent(this, this._logService.onDidChangeLogLevel, () => this._logService.getLevel() === LogLevel.Trace);
27
+ this._isTracingEnabled = observableFromEvent(
28
+ this,
29
+ this._logService.onDidChangeLogLevel,
30
+ () => this._logService.getLevel() === LogLevel.Trace
31
+ );
28
32
  const hadRecentActivity = wasTrueRecently(this.isUserActive, USER_ATTENTION_TIMEOUT_MS, this._store);
29
33
  this.hasUserAttention = derived(this, reader => {
30
34
  return hadRecentActivity.read(reader);
@@ -51,10 +55,7 @@ let UserAttentionService = class UserAttentionService extends Disposable {
51
55
  return this._timeKeeper.totalTimeMs();
52
56
  }
53
57
  };
54
- UserAttentionService = ( __decorate([
55
- ( __param(0, IInstantiationService)),
56
- ( __param(1, ILogService))
57
- ], UserAttentionService));
58
+ UserAttentionService = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, ILogService))], UserAttentionService));
58
59
  let UserAttentionServiceEnv = class UserAttentionServiceEnv extends Disposable {
59
60
  constructor(_hostService, _logService) {
60
61
  super();
@@ -66,12 +67,28 @@ let UserAttentionServiceEnv = class UserAttentionServiceEnv extends Disposable {
66
67
  const onActivity = () => {
67
68
  this._markUserActivity();
68
69
  };
69
- this._register(Event.runAndSubscribe(onDidRegisterWindow, ({ window, disposables }) => {
70
- disposables.add(addDisposableListener(window.document, 'keydown', onActivity, eventListenerOptions));
71
- disposables.add(addDisposableListener(window.document, 'mousemove', onActivity, eventListenerOptions));
72
- disposables.add(addDisposableListener(window.document, 'mousedown', onActivity, eventListenerOptions));
73
- disposables.add(addDisposableListener(window.document, 'touchstart', onActivity, eventListenerOptions));
74
- }, { window: mainWindow, disposables: this._store }));
70
+ this._register(Event.runAndSubscribe(onDidRegisterWindow, (
71
+ {
72
+ window,
73
+ disposables
74
+ }
75
+ ) => {
76
+ disposables.add(
77
+ addDisposableListener(window.document, "keydown", onActivity, eventListenerOptions)
78
+ );
79
+ disposables.add(
80
+ addDisposableListener(window.document, "mousemove", onActivity, eventListenerOptions)
81
+ );
82
+ disposables.add(
83
+ addDisposableListener(window.document, "mousedown", onActivity, eventListenerOptions)
84
+ );
85
+ disposables.add(
86
+ addDisposableListener(window.document, "touchstart", onActivity, eventListenerOptions)
87
+ );
88
+ }, {
89
+ window: mainWindow,
90
+ disposables: this._store
91
+ }));
75
92
  if (this._hostService.hasFocus) {
76
93
  this._markUserActivity();
77
94
  }
@@ -79,9 +96,8 @@ let UserAttentionServiceEnv = class UserAttentionServiceEnv extends Disposable {
79
96
  _markUserActivity() {
80
97
  if (this._activityDebounceTimeout !== undefined) {
81
98
  clearTimeout(this._activityDebounceTimeout);
82
- }
83
- else {
84
- this._logService.trace('[UserAttentionService] User activity detected');
99
+ } else {
100
+ this._logService.trace("[UserAttentionService] User activity detected");
85
101
  this._isUserActive.set(true, undefined);
86
102
  }
87
103
  this._activityDebounceTimeout = setTimeout(() => {
@@ -90,13 +106,10 @@ let UserAttentionServiceEnv = class UserAttentionServiceEnv extends Disposable {
90
106
  }, 500);
91
107
  }
92
108
  };
93
- UserAttentionServiceEnv = ( __decorate([
94
- ( __param(0, IHostService)),
95
- ( __param(1, ILogService))
96
- ], UserAttentionServiceEnv));
109
+ UserAttentionServiceEnv = ( __decorate([( __param(0, IHostService)), ( __param(1, ILogService))], UserAttentionServiceEnv));
97
110
  const eventListenerOptions = {
98
111
  passive: true,
99
- capture: true,
112
+ capture: true
100
113
  };
101
114
 
102
115
  export { UserAttentionService, UserAttentionServiceEnv };
@@ -12,7 +12,9 @@ import { NotificationPriority } from '@codingame/monaco-vscode-api/vscode/vs/pla
12
12
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
13
13
 
14
14
  let StoredFileWorkingCopySaveParticipant = class StoredFileWorkingCopySaveParticipant extends Disposable {
15
- get length() { return this.saveParticipants.size; }
15
+ get length() {
16
+ return this.saveParticipants.size;
17
+ }
16
18
  constructor(logService, progressService) {
17
19
  super();
18
20
  this.logService = logService;
@@ -27,15 +29,15 @@ let StoredFileWorkingCopySaveParticipant = class StoredFileWorkingCopySavePartic
27
29
  const cts = ( new CancellationTokenSource(token));
28
30
  workingCopy.model?.pushStackElement();
29
31
  progress.report({
30
- message: ( localize(14653, "Running Code Actions and Formatters..."))
32
+ message: ( localize(15050, "Running Code Actions and Formatters..."))
31
33
  });
32
34
  let bubbleCancel = false;
33
35
  await this.progressService.withProgress({
34
36
  priority: NotificationPriority.URGENT,
35
37
  location: ProgressLocation.Notification,
36
- cancellable: ( localize(14654, "Skip")),
38
+ cancellable: ( localize(15051, "Skip")),
37
39
  delay: workingCopy.isDirty() ? 5000 : 3000
38
- }, async (progress) => {
40
+ }, async progress => {
39
41
  const participants = Array.from(this.saveParticipants).sort((a, b) => {
40
42
  const aValue = a.ordinal ?? 0;
41
43
  const bValue = b.ordinal ?? 0;
@@ -48,12 +50,10 @@ let StoredFileWorkingCopySaveParticipant = class StoredFileWorkingCopySavePartic
48
50
  try {
49
51
  const promise = saveParticipant.participate(workingCopy, context, progress, cts.token);
50
52
  await raceCancellation(promise, cts.token);
51
- }
52
- catch (err) {
53
+ } catch (err) {
53
54
  if (!isCancellationError(err)) {
54
55
  this.logService.error(err);
55
- }
56
- else if (!cts.token.isCancellationRequested) {
56
+ } else if (!cts.token.isCancellationRequested) {
57
57
  cts.cancel();
58
58
  bubbleCancel = true;
59
59
  }
@@ -73,9 +73,6 @@ let StoredFileWorkingCopySaveParticipant = class StoredFileWorkingCopySavePartic
73
73
  super.dispose();
74
74
  }
75
75
  };
76
- StoredFileWorkingCopySaveParticipant = ( __decorate([
77
- ( __param(0, ILogService)),
78
- ( __param(1, IProgressService))
79
- ], StoredFileWorkingCopySaveParticipant));
76
+ StoredFileWorkingCopySaveParticipant = ( __decorate([( __param(0, ILogService)), ( __param(1, IProgressService))], StoredFileWorkingCopySaveParticipant));
80
77
 
81
78
  export { StoredFileWorkingCopySaveParticipant };
@@ -17,15 +17,14 @@ let WorkingCopyFileOperationParticipant = class WorkingCopyFileOperationParticip
17
17
  return toDisposable(() => remove());
18
18
  }
19
19
  async participate(files, operation, undoInfo, token) {
20
- const timeout = this.configurationService.getValue('files.participants.timeout');
21
- if (typeof timeout !== 'number' || timeout <= 0) {
20
+ const timeout = this.configurationService.getValue("files.participants.timeout");
21
+ if (typeof timeout !== "number" || timeout <= 0) {
22
22
  return;
23
23
  }
24
24
  for (const participant of this.participants) {
25
25
  try {
26
26
  await participant.participate(files, operation, undoInfo, timeout, token);
27
- }
28
- catch (err) {
27
+ } catch (err) {
29
28
  this.logService.warn(err);
30
29
  }
31
30
  }
@@ -35,9 +34,6 @@ let WorkingCopyFileOperationParticipant = class WorkingCopyFileOperationParticip
35
34
  super.dispose();
36
35
  }
37
36
  };
38
- WorkingCopyFileOperationParticipant = ( __decorate([
39
- ( __param(0, ILogService)),
40
- ( __param(1, IConfigurationService))
41
- ], WorkingCopyFileOperationParticipant));
37
+ WorkingCopyFileOperationParticipant = ( __decorate([( __param(0, ILogService)), ( __param(1, IConfigurationService))], WorkingCopyFileOperationParticipant));
42
38
 
43
39
  export { WorkingCopyFileOperationParticipant };
@@ -50,34 +50,49 @@ let WorkingCopyFileService = class WorkingCopyFileService extends Disposable {
50
50
  return [];
51
51
  }
52
52
  if (isFile) {
53
- const validateCreates = await Promises.settled(( operations.map(
54
- operation => this.fileService.canCreateFile(operation.resource, { overwrite: operation.overwrite })
55
- )));
53
+ const validateCreates = await Promises.settled(( operations.map(operation => this.fileService.canCreateFile(operation.resource, {
54
+ overwrite: operation.overwrite
55
+ }))));
56
56
  const error = validateCreates.find(validateCreate => validateCreate instanceof Error);
57
57
  if (error instanceof Error) {
58
58
  throw error;
59
59
  }
60
60
  }
61
- const files = ( operations.map(operation => ({ target: operation.resource })));
61
+ const files = ( operations.map(operation => ({
62
+ target: operation.resource
63
+ })));
62
64
  await this.runFileOperationParticipants(files, FileOperation.CREATE, undoInfo, token);
63
- const event = { correlationId: this.correlationIds++, operation: FileOperation.CREATE, files };
64
- await this._onWillRunWorkingCopyFileOperation.fireAsync(event, CancellationToken.None );
65
+ const event = {
66
+ correlationId: this.correlationIds++,
67
+ operation: FileOperation.CREATE,
68
+ files
69
+ };
70
+ await this._onWillRunWorkingCopyFileOperation.fireAsync(
71
+ event,
72
+ CancellationToken.None
73
+ );
65
74
  let stats;
66
75
  try {
67
76
  if (isFile) {
68
77
  stats = await Promises.settled(( operations.map(
69
- operation => this.fileService.createFile(operation.resource, operation.contents, { overwrite: operation.overwrite })
78
+ operation => this.fileService.createFile(operation.resource, operation.contents, {
79
+ overwrite: operation.overwrite
80
+ })
70
81
  )));
71
- }
72
- else {
82
+ } else {
73
83
  stats = await Promises.settled(( operations.map(operation => this.fileService.createFolder(operation.resource))));
74
84
  }
75
- }
76
- catch (error) {
77
- await this._onDidFailWorkingCopyFileOperation.fireAsync(event, CancellationToken.None );
85
+ } catch (error) {
86
+ await this._onDidFailWorkingCopyFileOperation.fireAsync(
87
+ event,
88
+ CancellationToken.None
89
+ );
78
90
  throw error;
79
91
  }
80
- await this._onDidRunWorkingCopyFileOperation.fireAsync(event, CancellationToken.None );
92
+ await this._onDidRunWorkingCopyFileOperation.fireAsync(
93
+ event,
94
+ CancellationToken.None
95
+ );
81
96
  return stats;
82
97
  }
83
98
  async move(operations, token, undoInfo) {
@@ -88,7 +103,13 @@ let WorkingCopyFileService = class WorkingCopyFileService extends Disposable {
88
103
  }
89
104
  async doMoveOrCopy(operations, move, token, undoInfo) {
90
105
  const stats = [];
91
- for (const { file: { source, target }, overwrite } of operations) {
106
+ for (const {
107
+ file: {
108
+ source,
109
+ target
110
+ },
111
+ overwrite
112
+ } of operations) {
92
113
  const validateMoveOrCopy = await (move ? this.fileService.canMove(source, target, overwrite) : this.fileService.canCopy(source, target, overwrite));
93
114
  if (validateMoveOrCopy instanceof Error) {
94
115
  throw validateMoveOrCopy;
@@ -96,54 +117,95 @@ let WorkingCopyFileService = class WorkingCopyFileService extends Disposable {
96
117
  }
97
118
  const files = ( operations.map(o => o.file));
98
119
  await this.runFileOperationParticipants(files, move ? FileOperation.MOVE : FileOperation.COPY, undoInfo, token);
99
- const event = { correlationId: this.correlationIds++, operation: move ? FileOperation.MOVE : FileOperation.COPY, files };
100
- await this._onWillRunWorkingCopyFileOperation.fireAsync(event, CancellationToken.None );
120
+ const event = {
121
+ correlationId: this.correlationIds++,
122
+ operation: move ? FileOperation.MOVE : FileOperation.COPY,
123
+ files
124
+ };
125
+ await this._onWillRunWorkingCopyFileOperation.fireAsync(
126
+ event,
127
+ CancellationToken.None
128
+ );
101
129
  try {
102
- for (const { file: { source, target }, overwrite } of operations) {
130
+ for (const {
131
+ file: {
132
+ source,
133
+ target
134
+ },
135
+ overwrite
136
+ } of operations) {
103
137
  if (!this.uriIdentityService.extUri.isEqual(source, target)) {
104
138
  const dirtyWorkingCopies = (move ? [...this.getDirty(source), ...this.getDirty(target)] : this.getDirty(target));
105
- await Promises.settled(( dirtyWorkingCopies.map(dirtyWorkingCopy => dirtyWorkingCopy.revert({ soft: true }))));
139
+ await Promises.settled(( dirtyWorkingCopies.map(dirtyWorkingCopy => dirtyWorkingCopy.revert({
140
+ soft: true
141
+ }))));
106
142
  }
107
143
  if (move) {
108
144
  stats.push(await this.fileService.move(source, target, overwrite));
109
- }
110
- else {
145
+ } else {
111
146
  stats.push(await this.fileService.copy(source, target, overwrite));
112
147
  }
113
148
  }
114
- }
115
- catch (error) {
116
- await this._onDidFailWorkingCopyFileOperation.fireAsync(event, CancellationToken.None );
149
+ } catch (error) {
150
+ await this._onDidFailWorkingCopyFileOperation.fireAsync(
151
+ event,
152
+ CancellationToken.None
153
+ );
117
154
  throw error;
118
155
  }
119
- await this._onDidRunWorkingCopyFileOperation.fireAsync(event, CancellationToken.None );
156
+ await this._onDidRunWorkingCopyFileOperation.fireAsync(
157
+ event,
158
+ CancellationToken.None
159
+ );
120
160
  return stats;
121
161
  }
122
162
  async delete(operations, token, undoInfo) {
123
163
  for (const operation of operations) {
124
- const validateDelete = await this.fileService.canDelete(operation.resource, { recursive: operation.recursive, useTrash: operation.useTrash });
164
+ const validateDelete = await this.fileService.canDelete(operation.resource, {
165
+ recursive: operation.recursive,
166
+ useTrash: operation.useTrash
167
+ });
125
168
  if (validateDelete instanceof Error) {
126
169
  throw validateDelete;
127
170
  }
128
171
  }
129
- const files = ( operations.map(operation => ({ target: operation.resource })));
172
+ const files = ( operations.map(operation => ({
173
+ target: operation.resource
174
+ })));
130
175
  await this.runFileOperationParticipants(files, FileOperation.DELETE, undoInfo, token);
131
- const event = { correlationId: this.correlationIds++, operation: FileOperation.DELETE, files };
132
- await this._onWillRunWorkingCopyFileOperation.fireAsync(event, CancellationToken.None );
176
+ const event = {
177
+ correlationId: this.correlationIds++,
178
+ operation: FileOperation.DELETE,
179
+ files
180
+ };
181
+ await this._onWillRunWorkingCopyFileOperation.fireAsync(
182
+ event,
183
+ CancellationToken.None
184
+ );
133
185
  for (const operation of operations) {
134
186
  const dirtyWorkingCopies = this.getDirty(operation.resource);
135
- await Promises.settled(( dirtyWorkingCopies.map(dirtyWorkingCopy => dirtyWorkingCopy.revert({ soft: true }))));
187
+ await Promises.settled(( dirtyWorkingCopies.map(dirtyWorkingCopy => dirtyWorkingCopy.revert({
188
+ soft: true
189
+ }))));
136
190
  }
137
191
  try {
138
192
  for (const operation of operations) {
139
- await this.fileService.del(operation.resource, { recursive: operation.recursive, useTrash: operation.useTrash });
193
+ await this.fileService.del(operation.resource, {
194
+ recursive: operation.recursive,
195
+ useTrash: operation.useTrash
196
+ });
140
197
  }
141
- }
142
- catch (error) {
143
- await this._onDidFailWorkingCopyFileOperation.fireAsync(event, CancellationToken.None );
198
+ } catch (error) {
199
+ await this._onDidFailWorkingCopyFileOperation.fireAsync(
200
+ event,
201
+ CancellationToken.None
202
+ );
144
203
  throw error;
145
204
  }
146
- await this._onDidRunWorkingCopyFileOperation.fireAsync(event, CancellationToken.None );
205
+ await this._onDidRunWorkingCopyFileOperation.fireAsync(
206
+ event,
207
+ CancellationToken.None
208
+ );
147
209
  }
148
210
  addFileOperationParticipant(participant) {
149
211
  return this.fileOperationParticipants.addFileOperationParticipant(participant);
@@ -151,7 +213,9 @@ let WorkingCopyFileService = class WorkingCopyFileService extends Disposable {
151
213
  runFileOperationParticipants(files, operation, undoInfo, token) {
152
214
  return this.fileOperationParticipants.participate(files, operation, undoInfo, token);
153
215
  }
154
- get hasSaveParticipants() { return this.saveParticipants.length > 0; }
216
+ get hasSaveParticipants() {
217
+ return this.saveParticipants.length > 0;
218
+ }
155
219
  addSaveParticipant(participant) {
156
220
  return this.saveParticipants.addSaveParticipant(participant);
157
221
  }
@@ -174,11 +238,6 @@ let WorkingCopyFileService = class WorkingCopyFileService extends Disposable {
174
238
  return Array.from(dirtyWorkingCopies);
175
239
  }
176
240
  };
177
- WorkingCopyFileService = ( __decorate([
178
- ( __param(0, IFileService)),
179
- ( __param(1, IWorkingCopyService)),
180
- ( __param(2, IInstantiationService)),
181
- ( __param(3, IUriIdentityService))
182
- ], WorkingCopyFileService));
241
+ WorkingCopyFileService = ( __decorate([( __param(0, IFileService)), ( __param(1, IWorkingCopyService)), ( __param(2, IInstantiationService)), ( __param(3, IUriIdentityService))], WorkingCopyFileService));
183
242
 
184
243
  export { WorkingCopyFileService };