@codingame/monaco-vscode-base-service-override 4.5.1 → 5.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 +2 -2
- package/vscode/src/vs/platform/download/common/downloadService.js +1 -1
- package/vscode/src/vs/workbench/services/configuration/common/jsonEditingService.js +14 -13
- package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +23 -26
- package/vscode/src/vs/workbench/services/request/browser/requestService.js +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +7 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-base-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.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@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@5.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -22,7 +22,7 @@ let DownloadService = class DownloadService {
|
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
24
|
const message = await asTextOrError(context);
|
|
25
|
-
throw new Error(`Expected 200, got back ${context.res.statusCode} instead.\n\n${message}`);
|
|
25
|
+
throw ( new Error(`Expected 200, got back ${context.res.statusCode} instead.\n\n${message}`));
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
};
|
|
@@ -12,12 +12,13 @@ import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resol
|
|
|
12
12
|
import { JSONEditingError } from './jsonEditing.js';
|
|
13
13
|
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
14
14
|
|
|
15
|
+
const _moduleId = "vs/workbench/services/configuration/common/jsonEditingService";
|
|
15
16
|
let JSONEditingService = class JSONEditingService {
|
|
16
17
|
constructor(fileService, textModelResolverService, textFileService) {
|
|
17
18
|
this.fileService = fileService;
|
|
18
19
|
this.textModelResolverService = textModelResolverService;
|
|
19
20
|
this.textFileService = textFileService;
|
|
20
|
-
this.queue = ( new Queue());
|
|
21
|
+
this.queue = ( (new Queue()));
|
|
21
22
|
}
|
|
22
23
|
write(resource, values) {
|
|
23
24
|
return Promise.resolve(this.queue.queue(() => this.doWriteConfiguration(resource, values)));
|
|
@@ -44,21 +45,21 @@ let JSONEditingService = class JSONEditingService {
|
|
|
44
45
|
applyEditsToBuffer(edit, model) {
|
|
45
46
|
const startPosition = model.getPositionAt(edit.offset);
|
|
46
47
|
const endPosition = model.getPositionAt(edit.offset + edit.length);
|
|
47
|
-
const range = ( new Range(
|
|
48
|
+
const range = ( (new Range(
|
|
48
49
|
startPosition.lineNumber,
|
|
49
50
|
startPosition.column,
|
|
50
51
|
endPosition.lineNumber,
|
|
51
52
|
endPosition.column
|
|
52
|
-
));
|
|
53
|
+
)));
|
|
53
54
|
const currentText = model.getValueInRange(range);
|
|
54
55
|
if (edit.content !== currentText) {
|
|
55
56
|
const editOperation = currentText ? EditOperation.replace(range, edit.content) : EditOperation.insert(startPosition, edit.content);
|
|
56
|
-
model.pushEditOperations([( new Selection(
|
|
57
|
+
model.pushEditOperations([( (new Selection(
|
|
57
58
|
startPosition.lineNumber,
|
|
58
59
|
startPosition.column,
|
|
59
60
|
startPosition.lineNumber,
|
|
60
61
|
startPosition.column
|
|
61
|
-
))], [editOperation], () => []);
|
|
62
|
+
)))], [editOperation], () => []);
|
|
62
63
|
return true;
|
|
63
64
|
}
|
|
64
65
|
return false;
|
|
@@ -100,24 +101,24 @@ let JSONEditingService = class JSONEditingService {
|
|
|
100
101
|
}
|
|
101
102
|
reject(code) {
|
|
102
103
|
const message = this.toErrorMessage(code);
|
|
103
|
-
return Promise.reject(( new JSONEditingError(message, code)));
|
|
104
|
+
return Promise.reject(( (new JSONEditingError(message, code))));
|
|
104
105
|
}
|
|
105
106
|
toErrorMessage(error) {
|
|
106
107
|
switch (error) {
|
|
107
108
|
case 0 : {
|
|
108
109
|
return ( localizeWithPath(
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
_moduleId,
|
|
111
|
+
0,
|
|
111
112
|
"Unable to write into the file. Please open the file to correct errors/warnings in the file and try again."
|
|
112
113
|
));
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
};
|
|
117
|
-
JSONEditingService = ( __decorate([
|
|
118
|
-
( __param(0, IFileService)),
|
|
119
|
-
( __param(1, ITextModelService)),
|
|
120
|
-
( __param(2, ITextFileService))
|
|
121
|
-
], JSONEditingService));
|
|
118
|
+
JSONEditingService = ( (__decorate([
|
|
119
|
+
( (__param(0, IFileService))),
|
|
120
|
+
( (__param(1, ITextModelService))),
|
|
121
|
+
( (__param(2, ITextFileService)))
|
|
122
|
+
], JSONEditingService)));
|
|
122
123
|
|
|
123
124
|
export { JSONEditingService };
|
|
@@ -28,10 +28,11 @@ import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
|
28
28
|
import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
29
29
|
import { getIconRegistry } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
30
30
|
|
|
31
|
+
const _moduleId = "vs/workbench/services/decorations/browser/decorationsService";
|
|
31
32
|
class DecorationRule {
|
|
32
33
|
static keyOf(data) {
|
|
33
34
|
if (Array.isArray(data)) {
|
|
34
|
-
return ( data.map(DecorationRule.keyOf)).join(',');
|
|
35
|
+
return ( (data.map(DecorationRule.keyOf))).join(',');
|
|
35
36
|
}
|
|
36
37
|
else {
|
|
37
38
|
const { color, letter } = data;
|
|
@@ -48,7 +49,7 @@ class DecorationRule {
|
|
|
48
49
|
this.themeService = themeService;
|
|
49
50
|
this._refCounter = 0;
|
|
50
51
|
this.data = data;
|
|
51
|
-
const suffix = ( hash(key).toString(36));
|
|
52
|
+
const suffix = ( (hash(key).toString(36)));
|
|
52
53
|
this.itemColorClassName = `${DecorationRule._classNamesPrefix}-itemColor-${suffix}`;
|
|
53
54
|
this.itemBadgeClassName = `${DecorationRule._classNamesPrefix}-itemBadge-${suffix}`;
|
|
54
55
|
this.bubbleBadgeClassName = `${DecorationRule._classNamesPrefix}-bubbleBadge-${suffix}`;
|
|
@@ -134,9 +135,9 @@ class DecorationRule {
|
|
|
134
135
|
class DecorationStyles {
|
|
135
136
|
constructor(_themeService) {
|
|
136
137
|
this._themeService = _themeService;
|
|
137
|
-
this._dispoables = ( new DisposableStore());
|
|
138
|
+
this._dispoables = ( (new DisposableStore()));
|
|
138
139
|
this._styleElement = createStyleSheet(undefined, undefined, this._dispoables);
|
|
139
|
-
this._decorationRules = ( new Map());
|
|
140
|
+
this._decorationRules = ( (new Map()));
|
|
140
141
|
}
|
|
141
142
|
dispose() {
|
|
142
143
|
this._dispoables.dispose();
|
|
@@ -146,7 +147,7 @@ class DecorationStyles {
|
|
|
146
147
|
const key = DecorationRule.keyOf(data);
|
|
147
148
|
let rule = this._decorationRules.get(key);
|
|
148
149
|
if (!rule) {
|
|
149
|
-
rule = ( new DecorationRule(this._themeService, data, key));
|
|
150
|
+
rule = ( (new DecorationRule(this._themeService, data, key)));
|
|
150
151
|
this._decorationRules.set(key, rule);
|
|
151
152
|
rule.appendCSSRules(this._styleElement);
|
|
152
153
|
}
|
|
@@ -154,15 +155,11 @@ class DecorationStyles {
|
|
|
154
155
|
const labelClassName = rule.itemColorClassName;
|
|
155
156
|
let badgeClassName = rule.itemBadgeClassName;
|
|
156
157
|
const iconClassName = rule.iconBadgeClassName;
|
|
157
|
-
let tooltip = distinct(( data.filter(d => !isFalsyOrWhitespace(d.tooltip)).map(d => d.tooltip))).join(' • ');
|
|
158
|
-
const strikethrough = ( data.some(d => d.strikethrough));
|
|
158
|
+
let tooltip = distinct(( (data.filter(d => !isFalsyOrWhitespace(d.tooltip)).map(d => d.tooltip)))).join(' • ');
|
|
159
|
+
const strikethrough = ( (data.some(d => d.strikethrough)));
|
|
159
160
|
if (onlyChildren) {
|
|
160
161
|
badgeClassName = rule.bubbleBadgeClassName;
|
|
161
|
-
tooltip = ( localizeWithPath(
|
|
162
|
-
'vs/workbench/services/decorations/browser/decorationsService',
|
|
163
|
-
'bubbleTitle',
|
|
164
|
-
"Contains emphasized items"
|
|
165
|
-
));
|
|
162
|
+
tooltip = ( localizeWithPath(_moduleId, 0, "Contains emphasized items"));
|
|
166
163
|
}
|
|
167
164
|
return {
|
|
168
165
|
labelClassName,
|
|
@@ -200,13 +197,13 @@ function getColor(color) {
|
|
|
200
197
|
}
|
|
201
198
|
let DecorationsService = class DecorationsService {
|
|
202
199
|
constructor(uriIdentityService, themeService) {
|
|
203
|
-
this._onDidChangeDecorationsDelayed = ( new DebounceEmitter({ merge: all => all.flat() }));
|
|
204
|
-
this._onDidChangeDecorations = ( new Emitter());
|
|
200
|
+
this._onDidChangeDecorationsDelayed = ( (new DebounceEmitter({ merge: all => all.flat() })));
|
|
201
|
+
this._onDidChangeDecorations = ( (new Emitter()));
|
|
205
202
|
this.onDidChangeDecorations = this._onDidChangeDecorations.event;
|
|
206
|
-
this._provider = ( new LinkedList());
|
|
207
|
-
this._decorationStyles = ( new DecorationStyles(themeService));
|
|
203
|
+
this._provider = ( (new LinkedList()));
|
|
204
|
+
this._decorationStyles = ( (new DecorationStyles(themeService)));
|
|
208
205
|
this._data = TernarySearchTree.forUris(key => uriIdentityService.extUri.ignorePathCasing(key));
|
|
209
|
-
this._onDidChangeDecorationsDelayed.event(event => { this._onDidChangeDecorations.fire(( new FileDecorationChangeEvent(event))); });
|
|
206
|
+
this._onDidChangeDecorationsDelayed.event(event => { this._onDidChangeDecorations.fire(( (new FileDecorationChangeEvent(event)))); });
|
|
210
207
|
}
|
|
211
208
|
dispose() {
|
|
212
209
|
this._onDidChangeDecorations.dispose();
|
|
@@ -249,7 +246,7 @@ let DecorationsService = class DecorationsService {
|
|
|
249
246
|
_ensureEntry(uri) {
|
|
250
247
|
let map = this._data.get(uri);
|
|
251
248
|
if (!map) {
|
|
252
|
-
map = ( new Map());
|
|
249
|
+
map = ( (new Map()));
|
|
253
250
|
this._data.set(uri, map);
|
|
254
251
|
}
|
|
255
252
|
return map;
|
|
@@ -271,7 +268,7 @@ let DecorationsService = class DecorationsService {
|
|
|
271
268
|
const iter = this._data.findSuperstr(uri);
|
|
272
269
|
if (iter) {
|
|
273
270
|
for (const tuple of iter) {
|
|
274
|
-
for (const data of ( tuple[1].values())) {
|
|
271
|
+
for (const data of ( (tuple[1].values()))) {
|
|
275
272
|
if (data && !(data instanceof DecorationDataRequest)) {
|
|
276
273
|
if (data.bubble) {
|
|
277
274
|
all.push(data);
|
|
@@ -292,14 +289,14 @@ let DecorationsService = class DecorationsService {
|
|
|
292
289
|
pendingRequest.source.cancel();
|
|
293
290
|
map.delete(provider);
|
|
294
291
|
}
|
|
295
|
-
const cts = ( new CancellationTokenSource());
|
|
292
|
+
const cts = ( (new CancellationTokenSource()));
|
|
296
293
|
const dataOrThenable = provider.provideDecorations(uri, cts.token);
|
|
297
294
|
if (!isThenable(dataOrThenable)) {
|
|
298
295
|
cts.dispose();
|
|
299
296
|
return this._keepItem(map, provider, uri, dataOrThenable);
|
|
300
297
|
}
|
|
301
298
|
else {
|
|
302
|
-
const request = ( new DecorationDataRequest(cts, Promise.resolve(dataOrThenable).then(data => {
|
|
299
|
+
const request = ( (new DecorationDataRequest(cts, Promise.resolve(dataOrThenable).then(data => {
|
|
303
300
|
if (map.get(provider) === request) {
|
|
304
301
|
this._keepItem(map, provider, uri, data);
|
|
305
302
|
}
|
|
@@ -309,7 +306,7 @@ let DecorationsService = class DecorationsService {
|
|
|
309
306
|
}
|
|
310
307
|
}).finally(() => {
|
|
311
308
|
cts.dispose();
|
|
312
|
-
})));
|
|
309
|
+
}))));
|
|
313
310
|
map.set(provider, request);
|
|
314
311
|
return null;
|
|
315
312
|
}
|
|
@@ -324,9 +321,9 @@ let DecorationsService = class DecorationsService {
|
|
|
324
321
|
return deco;
|
|
325
322
|
}
|
|
326
323
|
};
|
|
327
|
-
DecorationsService = ( __decorate([
|
|
328
|
-
( __param(0, IUriIdentityService)),
|
|
329
|
-
( __param(1, IThemeService))
|
|
330
|
-
], DecorationsService));
|
|
324
|
+
DecorationsService = ( (__decorate([
|
|
325
|
+
( (__param(0, IUriIdentityService))),
|
|
326
|
+
( (__param(1, IThemeService)))
|
|
327
|
+
], DecorationsService)));
|
|
331
328
|
|
|
332
329
|
export { DecorationsService };
|
package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js
CHANGED
|
@@ -7,6 +7,7 @@ import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/prog
|
|
|
7
7
|
import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
8
8
|
import { insert } from 'vscode/vscode/vs/base/common/arrays';
|
|
9
9
|
|
|
10
|
+
const _moduleId = "vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant";
|
|
10
11
|
let StoredFileWorkingCopySaveParticipant = class StoredFileWorkingCopySaveParticipant extends Disposable {
|
|
11
12
|
get length() { return this.saveParticipants.length; }
|
|
12
13
|
constructor(progressService, logService) {
|
|
@@ -20,14 +21,9 @@ let StoredFileWorkingCopySaveParticipant = class StoredFileWorkingCopySavePartic
|
|
|
20
21
|
return toDisposable(() => remove());
|
|
21
22
|
}
|
|
22
23
|
participate(workingCopy, context, token) {
|
|
23
|
-
const cts = ( new CancellationTokenSource(token));
|
|
24
|
+
const cts = ( (new CancellationTokenSource(token)));
|
|
24
25
|
return this.progressService.withProgress({
|
|
25
|
-
title: ( localizeWithPath(
|
|
26
|
-
'vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant',
|
|
27
|
-
'saveParticipants',
|
|
28
|
-
"Saving '{0}'",
|
|
29
|
-
workingCopy.name
|
|
30
|
-
)),
|
|
26
|
+
title: ( localizeWithPath(_moduleId, 0, "Saving '{0}'", workingCopy.name)),
|
|
31
27
|
location: 15 ,
|
|
32
28
|
cancellable: true,
|
|
33
29
|
delay: workingCopy.isDirty() ? 3000 : 5000
|
|
@@ -56,9 +52,9 @@ let StoredFileWorkingCopySaveParticipant = class StoredFileWorkingCopySavePartic
|
|
|
56
52
|
super.dispose();
|
|
57
53
|
}
|
|
58
54
|
};
|
|
59
|
-
StoredFileWorkingCopySaveParticipant = ( __decorate([
|
|
60
|
-
( __param(0, IProgressService)),
|
|
61
|
-
( __param(1, ILogService))
|
|
62
|
-
], StoredFileWorkingCopySaveParticipant));
|
|
55
|
+
StoredFileWorkingCopySaveParticipant = ( (__decorate([
|
|
56
|
+
( (__param(0, IProgressService))),
|
|
57
|
+
( (__param(1, ILogService)))
|
|
58
|
+
], StoredFileWorkingCopySaveParticipant)));
|
|
63
59
|
|
|
64
60
|
export { StoredFileWorkingCopySaveParticipant };
|