@codingame/monaco-vscode-base-service-override 10.1.4 → 11.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 +2 -2
- package/vscode/src/vs/workbench/services/configuration/common/jsonEditingService.js +1 -1
- package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +3 -2
- package/vscode/src/vs/workbench/services/label/common/labelService.js +13 -13
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +51 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-base-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.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@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@11.0.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -106,7 +106,7 @@ let JSONEditingService = class JSONEditingService {
|
|
|
106
106
|
switch (error) {
|
|
107
107
|
case 0 : {
|
|
108
108
|
return ( localize(
|
|
109
|
-
|
|
109
|
+
866,
|
|
110
110
|
"Unable to write into the file. Please open the file to correct errors/warnings in the file and try again."
|
|
111
111
|
));
|
|
112
112
|
}
|
|
@@ -5,7 +5,8 @@ import { TernarySearchTree } from 'vscode/vscode/vs/base/common/ternarySearchTre
|
|
|
5
5
|
import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
6
6
|
import { isThenable } from 'vscode/vscode/vs/base/common/async';
|
|
7
7
|
import { LinkedList } from 'vscode/vscode/vs/base/common/linkedList';
|
|
8
|
-
import { createCSSRule,
|
|
8
|
+
import { createCSSRule, removeCSSRulesContainingSelector, createStyleSheet } from 'vscode/vscode/vs/base/browser/dom';
|
|
9
|
+
import { asCSSPropertyValue } from 'vscode/vscode/vs/base/browser/cssValue';
|
|
9
10
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
|
|
10
11
|
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
11
12
|
import { isFalsyOrWhitespace } from 'vscode/vscode/vs/base/common/strings';
|
|
@@ -158,7 +159,7 @@ class DecorationStyles {
|
|
|
158
159
|
const strikethrough = ( (data.some(d => d.strikethrough)));
|
|
159
160
|
if (onlyChildren) {
|
|
160
161
|
badgeClassName = rule.bubbleBadgeClassName;
|
|
161
|
-
tooltip = ( localize(
|
|
162
|
+
tooltip = ( localize(867, "Contains emphasized items"));
|
|
162
163
|
}
|
|
163
164
|
return {
|
|
164
165
|
labelClassName,
|
|
@@ -26,7 +26,7 @@ import { Memento } from 'vscode/vscode/vs/workbench/common/memento';
|
|
|
26
26
|
const resourceLabelFormattersExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
27
27
|
extensionPoint: 'resourceLabelFormatters',
|
|
28
28
|
jsonSchema: {
|
|
29
|
-
description: ( localize(
|
|
29
|
+
description: ( localize(868, 'Contributes resource label formatting rules.')),
|
|
30
30
|
type: 'array',
|
|
31
31
|
items: {
|
|
32
32
|
type: 'object',
|
|
@@ -35,52 +35,52 @@ const resourceLabelFormattersExtPoint = ExtensionsRegistry.registerExtensionPoin
|
|
|
35
35
|
scheme: {
|
|
36
36
|
type: 'string',
|
|
37
37
|
description: ( localize(
|
|
38
|
-
|
|
38
|
+
869,
|
|
39
39
|
'URI scheme on which to match the formatter on. For example "file". Simple glob patterns are supported.'
|
|
40
40
|
)),
|
|
41
41
|
},
|
|
42
42
|
authority: {
|
|
43
43
|
type: 'string',
|
|
44
44
|
description: ( localize(
|
|
45
|
-
|
|
45
|
+
870,
|
|
46
46
|
'URI authority on which to match the formatter on. Simple glob patterns are supported.'
|
|
47
47
|
)),
|
|
48
48
|
},
|
|
49
49
|
formatting: {
|
|
50
|
-
description: ( localize(
|
|
50
|
+
description: ( localize(871, "Rules for formatting uri resource labels.")),
|
|
51
51
|
type: 'object',
|
|
52
52
|
properties: {
|
|
53
53
|
label: {
|
|
54
54
|
type: 'string',
|
|
55
55
|
description: ( localize(
|
|
56
|
-
|
|
56
|
+
872,
|
|
57
57
|
"Label rules to display. For example: myLabel:/${path}. ${path}, ${scheme}, ${authority} and ${authoritySuffix} are supported as variables."
|
|
58
58
|
))
|
|
59
59
|
},
|
|
60
60
|
separator: {
|
|
61
61
|
type: 'string',
|
|
62
62
|
description: ( localize(
|
|
63
|
-
|
|
63
|
+
873,
|
|
64
64
|
"Separator to be used in the uri label display. '/' or '\' as an example."
|
|
65
65
|
))
|
|
66
66
|
},
|
|
67
67
|
stripPathStartingSeparator: {
|
|
68
68
|
type: 'boolean',
|
|
69
69
|
description: ( localize(
|
|
70
|
-
|
|
70
|
+
874,
|
|
71
71
|
"Controls whether `${path}` substitutions should have starting separator characters stripped."
|
|
72
72
|
))
|
|
73
73
|
},
|
|
74
74
|
tildify: {
|
|
75
75
|
type: 'boolean',
|
|
76
76
|
description: ( localize(
|
|
77
|
-
|
|
77
|
+
875,
|
|
78
78
|
"Controls if the start of the uri label should be tildified when possible."
|
|
79
79
|
))
|
|
80
80
|
},
|
|
81
81
|
workspaceSuffix: {
|
|
82
82
|
type: 'string',
|
|
83
|
-
description: ( localize(
|
|
83
|
+
description: ( localize(876, "Suffix appended to the workspace label."))
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -259,10 +259,10 @@ let LabelService = class LabelService extends Disposable {
|
|
|
259
259
|
}
|
|
260
260
|
doGetWorkspaceLabel(workspaceUri, options) {
|
|
261
261
|
if (isUntitledWorkspace(workspaceUri, this.environmentService)) {
|
|
262
|
-
return ( localize(
|
|
262
|
+
return ( localize(877, "Untitled (Workspace)"));
|
|
263
263
|
}
|
|
264
264
|
if (isTemporaryWorkspace(workspaceUri)) {
|
|
265
|
-
return ( localize(
|
|
265
|
+
return ( localize(878, "Workspace"));
|
|
266
266
|
}
|
|
267
267
|
let filename = basename(workspaceUri);
|
|
268
268
|
if (filename.endsWith(WORKSPACE_EXTENSION)) {
|
|
@@ -275,14 +275,14 @@ let LabelService = class LabelService extends Disposable {
|
|
|
275
275
|
break;
|
|
276
276
|
case 2 :
|
|
277
277
|
label = ( localize(
|
|
278
|
-
|
|
278
|
+
879,
|
|
279
279
|
"{0} (Workspace)",
|
|
280
280
|
this.getUriLabel(joinPath(dirname(workspaceUri), filename))
|
|
281
281
|
));
|
|
282
282
|
break;
|
|
283
283
|
case 1 :
|
|
284
284
|
default:
|
|
285
|
-
label = ( localize(
|
|
285
|
+
label = ( localize(880, "{0} (Workspace)", filename));
|
|
286
286
|
break;
|
|
287
287
|
}
|
|
288
288
|
if (options?.verbose === 0 ) {
|
package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js
CHANGED
|
@@ -1,43 +1,74 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { raceCancellation } from 'vscode/vscode/vs/base/common/async';
|
|
3
|
+
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
3
4
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
5
|
+
import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress.service';
|
|
4
6
|
import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import {
|
|
7
|
+
import { LinkedList } from 'vscode/vscode/vs/base/common/linkedList';
|
|
8
|
+
import { isCancellationError, CancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
9
|
+
import { NotificationPriority } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
10
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
6
11
|
|
|
7
12
|
let StoredFileWorkingCopySaveParticipant = class StoredFileWorkingCopySaveParticipant extends Disposable {
|
|
8
|
-
get length() { return this.saveParticipants.
|
|
9
|
-
constructor(logService) {
|
|
13
|
+
get length() { return this.saveParticipants.size; }
|
|
14
|
+
constructor(logService, progressService) {
|
|
10
15
|
super();
|
|
11
16
|
this.logService = logService;
|
|
12
|
-
this.
|
|
17
|
+
this.progressService = progressService;
|
|
18
|
+
this.saveParticipants = ( (new LinkedList()));
|
|
13
19
|
}
|
|
14
20
|
addSaveParticipant(participant) {
|
|
15
|
-
const remove =
|
|
21
|
+
const remove = this.saveParticipants.push(participant);
|
|
16
22
|
return toDisposable(() => remove());
|
|
17
23
|
}
|
|
18
24
|
async participate(workingCopy, context, progress, token) {
|
|
25
|
+
const cts = ( (new CancellationTokenSource(token)));
|
|
19
26
|
workingCopy.model?.pushStackElement();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
progress.report({
|
|
28
|
+
message: ( localize(4599, "Running Code Actions and Formatters..."))
|
|
29
|
+
});
|
|
30
|
+
let bubbleCancel = false;
|
|
31
|
+
await this.progressService.withProgress({
|
|
32
|
+
priority: NotificationPriority.URGENT,
|
|
33
|
+
location: 15 ,
|
|
34
|
+
cancellable: ( localize(4600, "Skip")),
|
|
35
|
+
delay: workingCopy.isDirty() ? 5000 : 3000
|
|
36
|
+
}, async (progress) => {
|
|
37
|
+
for (const saveParticipant of this.saveParticipants) {
|
|
38
|
+
if (cts.token.isCancellationRequested || workingCopy.isDisposed()) {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const promise = saveParticipant.participate(workingCopy, context, progress, cts.token);
|
|
43
|
+
await raceCancellation(promise, cts.token);
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
if (!isCancellationError(err)) {
|
|
47
|
+
this.logService.error(err);
|
|
48
|
+
}
|
|
49
|
+
else if (!cts.token.isCancellationRequested) {
|
|
50
|
+
cts.cancel();
|
|
51
|
+
bubbleCancel = true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
23
54
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
this.logService.warn(err);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
55
|
+
}, () => {
|
|
56
|
+
cts.cancel();
|
|
57
|
+
});
|
|
32
58
|
workingCopy.model?.pushStackElement();
|
|
59
|
+
cts.dispose();
|
|
60
|
+
if (bubbleCancel) {
|
|
61
|
+
throw ( (new CancellationError()));
|
|
62
|
+
}
|
|
33
63
|
}
|
|
34
64
|
dispose() {
|
|
35
|
-
this.saveParticipants.
|
|
65
|
+
this.saveParticipants.clear();
|
|
36
66
|
super.dispose();
|
|
37
67
|
}
|
|
38
68
|
};
|
|
39
|
-
StoredFileWorkingCopySaveParticipant = ( __decorate([
|
|
40
|
-
( __param(0, ILogService))
|
|
41
|
-
|
|
69
|
+
StoredFileWorkingCopySaveParticipant = ( (__decorate([
|
|
70
|
+
( (__param(0, ILogService))),
|
|
71
|
+
( (__param(1, IProgressService)))
|
|
72
|
+
], StoredFileWorkingCopySaveParticipant)));
|
|
42
73
|
|
|
43
74
|
export { StoredFileWorkingCopySaveParticipant };
|