@codingame/monaco-vscode-base-service-override 25.1.1 → 26.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.
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
@@ -34,19 +34,22 @@ import { getIconRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform
34
34
  class DecorationRule {
35
35
  static keyOf(data) {
36
36
  if (Array.isArray(data)) {
37
- return ( data.map(DecorationRule.keyOf)).join(',');
38
- }
39
- else {
40
- const { color, letter } = data;
37
+ return ( data.map(DecorationRule.keyOf)).join(",");
38
+ } else {
39
+ const {
40
+ color,
41
+ letter
42
+ } = data;
41
43
  if (ThemeIcon.isThemeIcon(letter)) {
42
44
  return `${color}+${letter.id}`;
43
- }
44
- else {
45
+ } else {
45
46
  return `${color}/${letter}`;
46
47
  }
47
48
  }
48
49
  }
49
- static { this._classNamesPrefix = 'monaco-decoration'; }
50
+ static {
51
+ this._classNamesPrefix = "monaco-decoration";
52
+ }
50
53
  constructor(themeService, data, key) {
51
54
  this.themeService = themeService;
52
55
  this._refCounter = 0;
@@ -66,23 +69,30 @@ class DecorationRule {
66
69
  appendCSSRules(element) {
67
70
  if (!Array.isArray(this.data)) {
68
71
  this._appendForOne(this.data, element);
69
- }
70
- else {
72
+ } else {
71
73
  this._appendForMany(this.data, element);
72
74
  }
73
75
  }
74
76
  _appendForOne(data, element) {
75
- const { color, letter } = data;
77
+ const {
78
+ color,
79
+ letter
80
+ } = data;
76
81
  createCSSRule(`.${this.itemColorClassName}`, `color: ${getColor(color)};`, element);
77
82
  if (ThemeIcon.isThemeIcon(letter)) {
78
83
  this._createIconCSSRule(letter, color, element);
79
- }
80
- else if (letter) {
81
- createCSSRule(`.${this.itemBadgeClassName}::after`, `content: "${letter}"; color: ${getColor(color)};`, element);
84
+ } else if (letter) {
85
+ createCSSRule(
86
+ `.${this.itemBadgeClassName}::after`,
87
+ `content: "${letter}"; color: ${getColor(color)};`,
88
+ element
89
+ );
82
90
  }
83
91
  }
84
92
  _appendForMany(data, element) {
85
- const { color } = data.find(d => !!d.color) ?? data[0];
93
+ const {
94
+ color
95
+ } = data.find(d => !!d.color) ?? data[0];
86
96
  createCSSRule(`.${this.itemColorClassName}`, `color: ${getColor(color)};`, element);
87
97
  const letters = [];
88
98
  let icon;
@@ -90,19 +100,25 @@ class DecorationRule {
90
100
  if (ThemeIcon.isThemeIcon(d.letter)) {
91
101
  icon = d.letter;
92
102
  break;
93
- }
94
- else if (d.letter) {
103
+ } else if (d.letter) {
95
104
  letters.push(d.letter);
96
105
  }
97
106
  }
98
107
  if (icon) {
99
108
  this._createIconCSSRule(icon, color, element);
100
- }
101
- else {
109
+ } else {
102
110
  if (letters.length) {
103
- createCSSRule(`.${this.itemBadgeClassName}::after`, `content: "${letters.join(', ')}"; color: ${getColor(color)};`, element);
111
+ createCSSRule(
112
+ `.${this.itemBadgeClassName}::after`,
113
+ `content: "${letters.join(", ")}"; color: ${getColor(color)};`,
114
+ element
115
+ );
104
116
  }
105
- createCSSRule(`.${this.bubbleBadgeClassName}::after`, `content: "\uea71"; color: ${getColor(color)}; font-family: codicon; font-size: 14px; margin-right: 14px; opacity: 0.4;`, element);
117
+ createCSSRule(
118
+ `.${this.bubbleBadgeClassName}::after`,
119
+ `content: "\uea71"; color: ${getColor(color)}; font-family: codicon; font-size: 14px; margin-right: 14px; opacity: 0.4;`,
120
+ element
121
+ );
106
122
  }
107
123
  }
108
124
  _createIconCSSRule(icon, color, element) {
@@ -118,14 +134,18 @@ class DecorationRule {
118
134
  if (!definition) {
119
135
  return;
120
136
  }
121
- createCSSRule(`.${this.iconBadgeClassName}::after`, `content: '${definition.fontCharacter}';
122
- color: ${icon.color ? getColor(icon.color.id) : getColor(color)};
123
- font-family: ${stringValue(definition.font?.id ?? 'codicon')};
124
- font-size: 16px;
125
- margin-right: 14px;
126
- font-weight: normal;
127
- ${modifier === 'spin' ? 'animation: codicon-spin 1.5s steps(30) infinite; font-style: normal !important;' : ''};
128
- `, element);
137
+ createCSSRule(
138
+ `.${this.iconBadgeClassName}::after`,
139
+ `content: '${definition.fontCharacter}';
140
+ color: ${icon.color ? getColor(icon.color.id) : getColor(color)};
141
+ font-family: ${stringValue(definition.font?.id ?? "codicon")};
142
+ font-size: 16px;
143
+ margin-right: 14px;
144
+ font-weight: normal;
145
+ ${modifier === "spin" ? "animation: codicon-spin 1.5s steps(30) infinite; font-style: normal !important; transform-origin: center center;" : ""};
146
+ `,
147
+ element
148
+ );
129
149
  }
130
150
  removeCSSRules(element) {
131
151
  removeCSSRulesContainingSelector(this.itemColorClassName, element);
@@ -157,11 +177,11 @@ class DecorationStyles {
157
177
  const labelClassName = rule.itemColorClassName;
158
178
  let badgeClassName = rule.itemBadgeClassName;
159
179
  const iconClassName = rule.iconBadgeClassName;
160
- let tooltip = distinct(( data.filter(d => !isFalsyOrWhitespace(d.tooltip)).map(d => d.tooltip))).join('');
180
+ let tooltip = distinct(( data.filter(d => !isFalsyOrWhitespace(d.tooltip)).map(d => d.tooltip))).join("");
161
181
  const strikethrough = ( data.some(d => d.strikethrough));
162
182
  if (onlyChildren) {
163
183
  badgeClassName = rule.bubbleBadgeClassName;
164
- tooltip = ( localize(13839, "Contains emphasized items"));
184
+ tooltip = ( localize(14226, "Contains emphasized items"));
165
185
  }
166
186
  return {
167
187
  labelClassName,
@@ -195,18 +215,22 @@ class DecorationDataRequest {
195
215
  }
196
216
  }
197
217
  function getColor(color) {
198
- return color ? asCssVariable(color) : 'inherit';
218
+ return color ? asCssVariable(color) : "inherit";
199
219
  }
200
220
  let DecorationsService = class DecorationsService {
201
221
  constructor(uriIdentityService, themeService) {
202
222
  this._store = ( new DisposableStore());
203
- this._onDidChangeDecorationsDelayed = this._store.add(( new DebounceEmitter({ merge: all => all.flat() })));
223
+ this._onDidChangeDecorationsDelayed = this._store.add(( new DebounceEmitter({
224
+ merge: all => all.flat()
225
+ })));
204
226
  this._onDidChangeDecorations = this._store.add(( new Emitter()));
205
227
  this.onDidChangeDecorations = this._onDidChangeDecorations.event;
206
228
  this._provider = ( new LinkedList());
207
229
  this._decorationStyles = ( new DecorationStyles(themeService));
208
230
  this._data = TernarySearchTree.forUris(key => uriIdentityService.extUri.ignorePathCasing(key));
209
- this._store.add(this._onDidChangeDecorationsDelayed.event(event => { this._onDidChangeDecorations.fire(( new FileDecorationChangeEvent(event))); }));
231
+ this._store.add(this._onDidChangeDecorationsDelayed.event(event => {
232
+ this._onDidChangeDecorations.fire(( new FileDecorationChangeEvent(event)));
233
+ }));
210
234
  }
211
235
  dispose() {
212
236
  this._store.dispose();
@@ -215,7 +239,9 @@ let DecorationsService = class DecorationsService {
215
239
  registerDecorationsProvider(provider) {
216
240
  const rm = this._provider.unshift(provider);
217
241
  this._onDidChangeDecorations.fire({
218
- affectsResource() { return true; }
242
+ affectsResource() {
243
+ return true;
244
+ }
219
245
  });
220
246
  const removeAll = () => {
221
247
  const uris = [];
@@ -231,8 +257,7 @@ let DecorationsService = class DecorationsService {
231
257
  const listener = provider.onDidChange(uris => {
232
258
  if (!uris) {
233
259
  removeAll();
234
- }
235
- else {
260
+ } else {
236
261
  for (const uri of uris) {
237
262
  const map = this._ensureEntry(uri);
238
263
  this._fetchData(map, uri, provider);
@@ -281,9 +306,7 @@ let DecorationsService = class DecorationsService {
281
306
  }
282
307
  }
283
308
  }
284
- return all.length === 0
285
- ? undefined
286
- : this._decorationStyles.asDecoration(all, containsChildren);
309
+ return all.length === 0 ? undefined : this._decorationStyles.asDecoration(all, containsChildren);
287
310
  }
288
311
  _fetchData(map, uri, provider) {
289
312
  const pendingRequest = map.get(provider);
@@ -296,8 +319,7 @@ let DecorationsService = class DecorationsService {
296
319
  if (!isThenable(dataOrThenable)) {
297
320
  cts.dispose();
298
321
  return this._keepItem(map, provider, uri, dataOrThenable);
299
- }
300
- else {
322
+ } else {
301
323
  const request = ( new DecorationDataRequest(cts, Promise.resolve(dataOrThenable).then(data => {
302
324
  if (map.get(provider) === request) {
303
325
  this._keepItem(map, provider, uri, data);
@@ -323,9 +345,6 @@ let DecorationsService = class DecorationsService {
323
345
  return deco;
324
346
  }
325
347
  };
326
- DecorationsService = ( __decorate([
327
- ( __param(0, IUriIdentityService)),
328
- ( __param(1, IThemeService))
329
- ], DecorationsService));
348
+ DecorationsService = ( __decorate([( __param(0, IUriIdentityService)), ( __param(1, IThemeService))], DecorationsService));
330
349
 
331
350
  export { DecorationsService };
@@ -16,15 +16,25 @@ import { IWorkbenchExtensionEnablementService } from '@codingame/monaco-vscode-a
16
16
  import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
17
17
  import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
18
18
 
19
- const CODE_UNIFICATION_PREFIX = 'cmp-cht-';
20
- const EXTENSION_UNIFICATION_PREFIX = 'cmp-ext-';
21
- const CODE_UNIFICATION_FF = 'inlineCompletionsUnificationCode';
22
- const MODEL_UNIFICATION_FF = 'inlineCompletionsUnificationModel';
23
- const isRunningUnificationExperiment = ( new RawContextKey('isRunningUnificationExperiment', false));
24
- const ExtensionUnificationSetting = 'chat.extensionUnification.enabled';
19
+ const CODE_UNIFICATION_PREFIX = "cmp-cht-";
20
+ const EXTENSION_UNIFICATION_PREFIX = "cmp-ext-";
21
+ const CODE_UNIFICATION_FF = "inlineCompletionsUnificationCode";
22
+ const MODEL_UNIFICATION_FF = "inlineCompletionsUnificationModel";
23
+ const isRunningUnificationExperiment = ( new RawContextKey("isRunningUnificationExperiment", false));
24
+ const ExtensionUnificationSetting = "chat.extensionUnification.enabled";
25
25
  let InlineCompletionsUnificationImpl = class InlineCompletionsUnificationImpl extends Disposable {
26
- get state() { return this._state; }
27
- constructor(_assignmentService, _contextKeyService, _configurationService, _extensionEnablementService, _extensionManagementService, _extensionService, productService) {
26
+ get state() {
27
+ return this._state;
28
+ }
29
+ constructor(
30
+ _assignmentService,
31
+ _contextKeyService,
32
+ _configurationService,
33
+ _extensionEnablementService,
34
+ _extensionManagementService,
35
+ _extensionService,
36
+ productService
37
+ ) {
28
38
  super();
29
39
  this._assignmentService = _assignmentService;
30
40
  this._contextKeyService = _contextKeyService;
@@ -39,13 +49,16 @@ let InlineCompletionsUnificationImpl = class InlineCompletionsUnificationImpl ex
39
49
  this._onDidChangeExtensionUnificationSetting = this._register(( new Emitter()));
40
50
  this._completionsExtensionId = productService.defaultChatAgent?.extensionId.toLowerCase();
41
51
  this._chatExtensionId = productService.defaultChatAgent?.chatExtensionId.toLowerCase();
42
- const relevantExtensions = [this._completionsExtensionId, this._chatExtensionId].filter((id) => !!id);
52
+ const relevantExtensions = [this._completionsExtensionId, this._chatExtensionId].filter(id => !!id);
43
53
  this.isRunningUnificationExperiment = isRunningUnificationExperiment.bindTo(this._contextKeyService);
44
54
  this._assignmentService.addTelemetryAssignmentFilter({
45
- exclude: (assignment) => assignment.startsWith(EXTENSION_UNIFICATION_PREFIX) && this._state.extensionUnification !== this._configurationService.getValue(ExtensionUnificationSetting),
46
- onDidChange: Event.any(this._onDidChangeExtensionUnificationState.event, this._onDidChangeExtensionUnificationSetting.event)
55
+ exclude: assignment => assignment.startsWith(EXTENSION_UNIFICATION_PREFIX) && this._state.extensionUnification !== this._configurationService.getValue(ExtensionUnificationSetting),
56
+ onDidChange: Event.any(
57
+ this._onDidChangeExtensionUnificationState.event,
58
+ this._onDidChangeExtensionUnificationSetting.event
59
+ )
47
60
  });
48
- this._register(this._extensionEnablementService.onEnablementChanged((extensions) => {
61
+ this._register(this._extensionEnablementService.onEnablementChanged(extensions => {
49
62
  if (( extensions.some(ext => relevantExtensions.includes(ext.identifier.id.toLowerCase())))) {
50
63
  this._update();
51
64
  }
@@ -56,7 +69,11 @@ let InlineCompletionsUnificationImpl = class InlineCompletionsUnificationImpl ex
56
69
  this._onDidChangeExtensionUnificationSetting.fire();
57
70
  }
58
71
  }));
59
- this._register(this._extensionService.onDidChangeExtensions(({ added }) => {
72
+ this._register(this._extensionService.onDidChangeExtensions((
73
+ {
74
+ added
75
+ }
76
+ ) => {
60
77
  if (( added.some(ext => relevantExtensions.includes(ext.identifier.value.toLowerCase())))) {
61
78
  this._update();
62
79
  }
@@ -76,14 +93,18 @@ let InlineCompletionsUnificationImpl = class InlineCompletionsUnificationImpl ex
76
93
  codeUnificationFF === true,
77
94
  modelUnificationFF === true,
78
95
  extensionUnificationEnabled,
79
- currentExperiments?.filter(exp => exp.startsWith(CODE_UNIFICATION_PREFIX) || (extensionStatesMatchUnificationSetting && exp.startsWith(EXTENSION_UNIFICATION_PREFIX))) ?? []
96
+ currentExperiments?.filter(
97
+ exp => exp.startsWith(CODE_UNIFICATION_PREFIX) || (extensionStatesMatchUnificationSetting && exp.startsWith(EXTENSION_UNIFICATION_PREFIX))
98
+ ) ?? []
80
99
  ));
81
100
  if (this._state.equals(newState)) {
82
101
  return;
83
102
  }
84
103
  const previousState = this._state;
85
104
  this._state = newState;
86
- this.isRunningUnificationExperiment.set(this._state.codeUnification || this._state.modelUnification || this._state.extensionUnification);
105
+ this.isRunningUnificationExperiment.set(
106
+ this._state.codeUnification || this._state.modelUnification || this._state.extensionUnification
107
+ );
87
108
  this._onDidStateChange.fire();
88
109
  if (previousState.extensionUnification !== this._state.extensionUnification) {
89
110
  this._onDidChangeExtensionUnificationState.fire();
@@ -106,7 +127,7 @@ let InlineCompletionsUnificationImpl = class InlineCompletionsUnificationImpl ex
106
127
  }
107
128
  const completionExtensionInstalled = installedExtensions.filter(ext => ext.identifier.id.toLowerCase() === this._completionsExtensionId);
108
129
  if (completionExtensionInstalled.length === 0) {
109
- return false;
130
+ return true;
110
131
  }
111
132
  const completionsExtensionDisabledByUnification = ( completionExtensionInstalled.some(
112
133
  ext => this._extensionEnablementService.getEnablementState(ext) === EnablementState.DisabledByUnification
@@ -114,15 +135,7 @@ let InlineCompletionsUnificationImpl = class InlineCompletionsUnificationImpl ex
114
135
  return !!chatExtension && completionsExtensionDisabledByUnification;
115
136
  }
116
137
  };
117
- InlineCompletionsUnificationImpl = ( __decorate([
118
- ( __param(0, IWorkbenchAssignmentService)),
119
- ( __param(1, IContextKeyService)),
120
- ( __param(2, IConfigurationService)),
121
- ( __param(3, IWorkbenchExtensionEnablementService)),
122
- ( __param(4, IExtensionManagementService)),
123
- ( __param(5, IExtensionService)),
124
- ( __param(6, IProductService))
125
- ], InlineCompletionsUnificationImpl));
138
+ InlineCompletionsUnificationImpl = ( __decorate([( __param(0, IWorkbenchAssignmentService)), ( __param(1, IContextKeyService)), ( __param(2, IConfigurationService)), ( __param(3, IWorkbenchExtensionEnablementService)), ( __param(4, IExtensionManagementService)), ( __param(5, IExtensionService)), ( __param(6, IProductService))], InlineCompletionsUnificationImpl));
126
139
  class InlineCompletionsUnificationState {
127
140
  constructor(codeUnification, modelUnification, extensionUnification, expAssignments) {
128
141
  this.codeUnification = codeUnification;
@@ -131,10 +144,7 @@ class InlineCompletionsUnificationState {
131
144
  this.expAssignments = expAssignments;
132
145
  }
133
146
  equals(other) {
134
- return this.codeUnification === other.codeUnification
135
- && this.modelUnification === other.modelUnification
136
- && this.extensionUnification === other.extensionUnification
137
- && equals(this.expAssignments, other.expAssignments);
147
+ return this.codeUnification === other.codeUnification && this.modelUnification === other.modelUnification && this.extensionUnification === other.extensionUnification && equals(this.expAssignments, other.expAssignments);
138
148
  }
139
149
  }
140
150