@codingame/monaco-vscode-view-status-bar-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.
- package/index.js +1 -1
- package/package.json +2 -2
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarActions.js +18 -22
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarItem.js +71 -61
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarModel.js +37 -28
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarPart.js +214 -152
- package/vscode/src/vs/workbench/api/browser/statusBarExtensionPoint.d.ts +0 -4
- package/vscode/src/vs/workbench/api/browser/statusBarExtensionPoint.js +0 -152
package/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/
|
|
|
3
3
|
import { StatusbarService } from './vscode/src/vs/workbench/browser/parts/statusbar/statusbarPart.js';
|
|
4
4
|
import { IStatusbarService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
5
5
|
import { IExtensionStatusBarItemService, ExtensionStatusBarItemService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/browser/statusBarService';
|
|
6
|
-
import '
|
|
6
|
+
import '@codingame/monaco-vscode-api/vscode/vs/workbench/api/browser/statusBarExtensionPoint';
|
|
7
7
|
|
|
8
8
|
function getServiceOverride() {
|
|
9
9
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-view-status-bar-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "26.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - view-status-bar service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "26.0.1"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -23,15 +23,14 @@ class ToggleStatusbarEntryVisibilityAction extends Action {
|
|
|
23
23
|
async run() {
|
|
24
24
|
if (this.model.isHidden(this.id)) {
|
|
25
25
|
this.model.show(this.id);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
26
|
+
} else {
|
|
28
27
|
this.model.hide(this.id);
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
class HideStatusbarEntryAction extends Action {
|
|
33
32
|
constructor(id, name, model) {
|
|
34
|
-
super(id, ( localize(
|
|
33
|
+
super(id, ( localize(3645, "Hide '{0}'", name)), undefined, true);
|
|
35
34
|
this.model = model;
|
|
36
35
|
}
|
|
37
36
|
async run() {
|
|
@@ -40,73 +39,70 @@ class HideStatusbarEntryAction extends Action {
|
|
|
40
39
|
}
|
|
41
40
|
let ManageExtensionAction = class ManageExtensionAction extends Action {
|
|
42
41
|
constructor(extensionId, commandService) {
|
|
43
|
-
super(
|
|
42
|
+
super("statusbar.manage.extension", ( localize(3646, "Manage Extension")));
|
|
44
43
|
this.extensionId = extensionId;
|
|
45
44
|
this.commandService = commandService;
|
|
46
45
|
}
|
|
47
46
|
run() {
|
|
48
|
-
return this.commandService.executeCommand(
|
|
47
|
+
return this.commandService.executeCommand("_extensions.manage", this.extensionId);
|
|
49
48
|
}
|
|
50
49
|
};
|
|
51
|
-
ManageExtensionAction = ( __decorate([
|
|
52
|
-
( __param(1, ICommandService))
|
|
53
|
-
], ManageExtensionAction));
|
|
50
|
+
ManageExtensionAction = ( __decorate([( __param(1, ICommandService))], ManageExtensionAction));
|
|
54
51
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
55
|
-
id:
|
|
52
|
+
id: "workbench.statusBar.focusPrevious",
|
|
56
53
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
57
54
|
primary: KeyCode.LeftArrow,
|
|
58
55
|
secondary: [KeyCode.UpArrow],
|
|
59
56
|
when: StatusBarFocused,
|
|
60
|
-
handler:
|
|
57
|
+
handler: accessor => {
|
|
61
58
|
const statusBarService = accessor.get(IStatusbarService);
|
|
62
59
|
statusBarService.focusPreviousEntry();
|
|
63
60
|
}
|
|
64
61
|
});
|
|
65
62
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
66
|
-
id:
|
|
63
|
+
id: "workbench.statusBar.focusNext",
|
|
67
64
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
68
65
|
primary: KeyCode.RightArrow,
|
|
69
66
|
secondary: [KeyCode.DownArrow],
|
|
70
67
|
when: StatusBarFocused,
|
|
71
|
-
handler:
|
|
68
|
+
handler: accessor => {
|
|
72
69
|
const statusBarService = accessor.get(IStatusbarService);
|
|
73
70
|
statusBarService.focusNextEntry();
|
|
74
71
|
}
|
|
75
72
|
});
|
|
76
73
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
77
|
-
id:
|
|
74
|
+
id: "workbench.statusBar.focusFirst",
|
|
78
75
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
79
76
|
primary: KeyCode.Home,
|
|
80
77
|
when: StatusBarFocused,
|
|
81
|
-
handler:
|
|
78
|
+
handler: accessor => {
|
|
82
79
|
const statusBarService = accessor.get(IStatusbarService);
|
|
83
80
|
statusBarService.focus(false);
|
|
84
81
|
statusBarService.focusNextEntry();
|
|
85
82
|
}
|
|
86
83
|
});
|
|
87
84
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
88
|
-
id:
|
|
85
|
+
id: "workbench.statusBar.focusLast",
|
|
89
86
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
90
87
|
primary: KeyCode.End,
|
|
91
88
|
when: StatusBarFocused,
|
|
92
|
-
handler:
|
|
89
|
+
handler: accessor => {
|
|
93
90
|
const statusBarService = accessor.get(IStatusbarService);
|
|
94
91
|
statusBarService.focus(false);
|
|
95
92
|
statusBarService.focusPreviousEntry();
|
|
96
93
|
}
|
|
97
94
|
});
|
|
98
95
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
99
|
-
id:
|
|
96
|
+
id: "workbench.statusBar.clearFocus",
|
|
100
97
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
101
98
|
primary: KeyCode.Escape,
|
|
102
99
|
when: StatusBarFocused,
|
|
103
|
-
handler:
|
|
100
|
+
handler: accessor => {
|
|
104
101
|
const statusBarService = accessor.get(IStatusbarService);
|
|
105
102
|
const editorService = accessor.get(IEditorService);
|
|
106
103
|
if (statusBarService.isEntryFocused()) {
|
|
107
104
|
statusBarService.focus(false);
|
|
108
|
-
}
|
|
109
|
-
else if (editorService.activeEditorPane) {
|
|
105
|
+
} else if (editorService.activeEditorPane) {
|
|
110
106
|
editorService.activeEditorPane.focus();
|
|
111
107
|
}
|
|
112
108
|
}
|
|
@@ -114,8 +110,8 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
114
110
|
class FocusStatusBarAction extends Action2 {
|
|
115
111
|
constructor() {
|
|
116
112
|
super({
|
|
117
|
-
id:
|
|
118
|
-
title: ( localize2(
|
|
113
|
+
id: "workbench.action.focusStatusBar",
|
|
114
|
+
title: ( localize2(3647, "Focus Status Bar")),
|
|
119
115
|
category: Categories.View,
|
|
120
116
|
f1: true
|
|
121
117
|
});
|
|
@@ -24,9 +24,18 @@ let StatusbarEntryItem = class StatusbarEntryItem extends Disposable {
|
|
|
24
24
|
return assertReturnsDefined(this.entry).name;
|
|
25
25
|
}
|
|
26
26
|
get hasCommand() {
|
|
27
|
-
return typeof this.entry?.command !==
|
|
27
|
+
return typeof this.entry?.command !== "undefined";
|
|
28
28
|
}
|
|
29
|
-
constructor(
|
|
29
|
+
constructor(
|
|
30
|
+
container,
|
|
31
|
+
entry,
|
|
32
|
+
hoverDelegate,
|
|
33
|
+
commandService,
|
|
34
|
+
hoverService,
|
|
35
|
+
notificationService,
|
|
36
|
+
telemetryService,
|
|
37
|
+
themeService
|
|
38
|
+
) {
|
|
30
39
|
super();
|
|
31
40
|
this.container = container;
|
|
32
41
|
this.hoverDelegate = hoverDelegate;
|
|
@@ -42,14 +51,14 @@ let StatusbarEntryItem = class StatusbarEntryItem extends Disposable {
|
|
|
42
51
|
this.commandTouchListener = this._register(( new MutableDisposable()));
|
|
43
52
|
this.commandKeyboardListener = this._register(( new MutableDisposable()));
|
|
44
53
|
this.hover = undefined;
|
|
45
|
-
this.labelContainer = $(
|
|
46
|
-
role:
|
|
54
|
+
this.labelContainer = $("a.statusbar-item-label", {
|
|
55
|
+
role: "button",
|
|
47
56
|
tabIndex: -1
|
|
48
57
|
});
|
|
49
58
|
this._register(Gesture.addTarget(this.labelContainer));
|
|
50
59
|
this.label = this._register(( new StatusBarCodiconLabel(this.labelContainer)));
|
|
51
60
|
this.container.appendChild(this.labelContainer);
|
|
52
|
-
this.beakContainer = $(
|
|
61
|
+
this.beakContainer = $(".status-bar-item-beak-container");
|
|
53
62
|
this.container.appendChild(this.beakContainer);
|
|
54
63
|
if (entry.content) {
|
|
55
64
|
this.container.appendChild(entry.content);
|
|
@@ -62,17 +71,16 @@ let StatusbarEntryItem = class StatusbarEntryItem extends Disposable {
|
|
|
62
71
|
this.label.text = entry.text;
|
|
63
72
|
if (entry.text) {
|
|
64
73
|
show(this.labelContainer);
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
74
|
+
} else {
|
|
67
75
|
hide(this.labelContainer);
|
|
68
76
|
}
|
|
69
77
|
}
|
|
70
78
|
if (!this.entry || entry.ariaLabel !== this.entry.ariaLabel) {
|
|
71
|
-
this.container.setAttribute(
|
|
72
|
-
this.labelContainer.setAttribute(
|
|
79
|
+
this.container.setAttribute("aria-label", entry.ariaLabel);
|
|
80
|
+
this.labelContainer.setAttribute("aria-label", entry.ariaLabel);
|
|
73
81
|
}
|
|
74
82
|
if (!this.entry || entry.role !== this.entry.role) {
|
|
75
|
-
this.labelContainer.setAttribute(
|
|
83
|
+
this.labelContainer.setAttribute("role", entry.role || "button");
|
|
76
84
|
}
|
|
77
85
|
if (!this.entry || !this.isEqualTooltip(this.entry, entry)) {
|
|
78
86
|
let hoverOptions;
|
|
@@ -86,16 +94,19 @@ let StatusbarEntryItem = class StatusbarEntryItem extends Disposable {
|
|
|
86
94
|
run: () => this.executeCommand(command)
|
|
87
95
|
})))
|
|
88
96
|
};
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
97
|
+
} else {
|
|
91
98
|
hoverTooltip = entry.tooltip;
|
|
92
99
|
}
|
|
93
|
-
const hoverContents = isMarkdownString(hoverTooltip) ? {
|
|
100
|
+
const hoverContents = isMarkdownString(hoverTooltip) ? {
|
|
101
|
+
markdown: hoverTooltip,
|
|
102
|
+
markdownNotSupportedFallback: undefined
|
|
103
|
+
} : hoverTooltip;
|
|
94
104
|
if (this.hover) {
|
|
95
105
|
this.hover.update(hoverContents, hoverOptions);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
106
|
+
} else {
|
|
107
|
+
this.hover = this._register(
|
|
108
|
+
this.hoverService.setupManagedHover(this.hoverDelegate, this.container, hoverContents, hoverOptions)
|
|
109
|
+
);
|
|
99
110
|
}
|
|
100
111
|
}
|
|
101
112
|
if (!this.entry || entry.command !== this.entry.command) {
|
|
@@ -105,52 +116,60 @@ let StatusbarEntryItem = class StatusbarEntryItem extends Disposable {
|
|
|
105
116
|
const command = entry.command;
|
|
106
117
|
if (command && (command !== ShowTooltipCommand || this.hover) ) {
|
|
107
118
|
this.commandMouseListener.value = addDisposableListener(this.labelContainer, EventType.CLICK, () => this.executeCommand(command));
|
|
108
|
-
this.commandTouchListener.value = addDisposableListener(
|
|
119
|
+
this.commandTouchListener.value = addDisposableListener(
|
|
120
|
+
this.labelContainer,
|
|
121
|
+
EventType$1.Tap,
|
|
122
|
+
() => this.executeCommand(command)
|
|
123
|
+
);
|
|
109
124
|
this.commandKeyboardListener.value = addDisposableListener(this.labelContainer, EventType.KEY_DOWN, e => {
|
|
110
125
|
const event = ( new StandardKeyboardEvent(e));
|
|
111
126
|
if (event.equals(KeyCode.Space) || event.equals(KeyCode.Enter)) {
|
|
112
127
|
EventHelper.stop(e);
|
|
113
128
|
this.executeCommand(command);
|
|
114
|
-
}
|
|
115
|
-
else if (event.equals(KeyCode.Escape) || event.equals(KeyCode.LeftArrow) || event.equals(KeyCode.RightArrow)) {
|
|
129
|
+
} else if (event.equals(KeyCode.Escape) || event.equals(KeyCode.LeftArrow) || event.equals(KeyCode.RightArrow)) {
|
|
116
130
|
EventHelper.stop(e);
|
|
117
131
|
this.hover?.hide();
|
|
118
132
|
}
|
|
119
133
|
});
|
|
120
|
-
this.labelContainer.classList.remove(
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
this.labelContainer.classList.add('disabled');
|
|
134
|
+
this.labelContainer.classList.remove("disabled");
|
|
135
|
+
} else {
|
|
136
|
+
this.labelContainer.classList.add("disabled");
|
|
124
137
|
}
|
|
125
138
|
}
|
|
126
139
|
if (!this.entry || entry.showBeak !== this.entry.showBeak) {
|
|
127
140
|
if (entry.showBeak) {
|
|
128
|
-
this.container.classList.add(
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
this.container.classList.remove('has-beak');
|
|
141
|
+
this.container.classList.add("has-beak");
|
|
142
|
+
} else {
|
|
143
|
+
this.container.classList.remove("has-beak");
|
|
132
144
|
}
|
|
133
145
|
}
|
|
134
|
-
const hasBackgroundColor = !!entry.backgroundColor || (entry.kind && entry.kind !==
|
|
146
|
+
const hasBackgroundColor = !!entry.backgroundColor || (entry.kind && entry.kind !== "standard");
|
|
135
147
|
if (!this.entry || entry.kind !== this.entry.kind) {
|
|
136
148
|
for (const kind of StatusbarEntryKinds) {
|
|
137
149
|
this.container.classList.remove(`${kind}-kind`);
|
|
138
150
|
}
|
|
139
|
-
if (entry.kind && entry.kind !==
|
|
151
|
+
if (entry.kind && entry.kind !== "standard") {
|
|
140
152
|
this.container.classList.add(`${entry.kind}-kind`);
|
|
141
153
|
}
|
|
142
|
-
this.container.classList.toggle(
|
|
154
|
+
this.container.classList.toggle("has-background-color", hasBackgroundColor);
|
|
143
155
|
}
|
|
144
156
|
if (!this.entry || entry.color !== this.entry.color) {
|
|
145
157
|
this.applyColor(this.labelContainer, entry.color);
|
|
146
158
|
}
|
|
147
159
|
if (!this.entry || entry.backgroundColor !== this.entry.backgroundColor) {
|
|
148
|
-
this.container.classList.toggle(
|
|
160
|
+
this.container.classList.toggle("has-background-color", hasBackgroundColor);
|
|
149
161
|
this.applyColor(this.container, entry.backgroundColor, true);
|
|
150
162
|
}
|
|
151
163
|
this.entry = entry;
|
|
152
164
|
}
|
|
153
|
-
isEqualTooltip(
|
|
165
|
+
isEqualTooltip(
|
|
166
|
+
{
|
|
167
|
+
tooltip
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
tooltip: otherTooltip
|
|
171
|
+
}
|
|
172
|
+
) {
|
|
154
173
|
if (tooltip === undefined) {
|
|
155
174
|
return otherTooltip === undefined;
|
|
156
175
|
}
|
|
@@ -164,13 +183,15 @@ let StatusbarEntryItem = class StatusbarEntryItem extends Disposable {
|
|
|
164
183
|
this.hover?.show(true );
|
|
165
184
|
}
|
|
166
185
|
else {
|
|
167
|
-
const id = typeof command ===
|
|
168
|
-
const args = typeof command ===
|
|
169
|
-
this.telemetryService.publicLog2(
|
|
186
|
+
const id = typeof command === "string" ? command : command.id;
|
|
187
|
+
const args = typeof command === "string" ? [] : command.arguments ?? [];
|
|
188
|
+
this.telemetryService.publicLog2("workbenchActionExecuted", {
|
|
189
|
+
id,
|
|
190
|
+
from: "status bar"
|
|
191
|
+
});
|
|
170
192
|
try {
|
|
171
193
|
await this.commandService.executeCommand(id, ...args);
|
|
172
|
-
}
|
|
173
|
-
catch (error) {
|
|
194
|
+
} catch (error) {
|
|
174
195
|
this.notificationService.error(toErrorMessage(error));
|
|
175
196
|
}
|
|
176
197
|
}
|
|
@@ -179,8 +200,7 @@ let StatusbarEntryItem = class StatusbarEntryItem extends Disposable {
|
|
|
179
200
|
let colorResult = undefined;
|
|
180
201
|
if (isBackground) {
|
|
181
202
|
this.backgroundListener.clear();
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
203
|
+
} else {
|
|
184
204
|
this.foregroundListener.clear();
|
|
185
205
|
}
|
|
186
206
|
if (color) {
|
|
@@ -189,50 +209,40 @@ let StatusbarEntryItem = class StatusbarEntryItem extends Disposable {
|
|
|
189
209
|
const listener = this.themeService.onDidColorThemeChange(theme => {
|
|
190
210
|
const colorValue = theme.getColor(color.id)?.toString();
|
|
191
211
|
if (isBackground) {
|
|
192
|
-
container.style.backgroundColor = colorValue ??
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
container.style.color = colorValue ?? '';
|
|
212
|
+
container.style.backgroundColor = colorValue ?? "";
|
|
213
|
+
} else {
|
|
214
|
+
container.style.color = colorValue ?? "";
|
|
196
215
|
}
|
|
197
216
|
});
|
|
198
217
|
if (isBackground) {
|
|
199
218
|
this.backgroundListener.value = listener;
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
219
|
+
} else {
|
|
202
220
|
this.foregroundListener.value = listener;
|
|
203
221
|
}
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
222
|
+
} else {
|
|
206
223
|
colorResult = color;
|
|
207
224
|
}
|
|
208
225
|
}
|
|
209
226
|
if (isBackground) {
|
|
210
|
-
container.style.backgroundColor = colorResult ??
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
container.style.color = colorResult ?? '';
|
|
227
|
+
container.style.backgroundColor = colorResult ?? "";
|
|
228
|
+
} else {
|
|
229
|
+
container.style.color = colorResult ?? "";
|
|
214
230
|
}
|
|
215
231
|
}
|
|
216
232
|
};
|
|
217
|
-
StatusbarEntryItem = ( __decorate([
|
|
218
|
-
( __param(3, ICommandService)),
|
|
219
|
-
( __param(4, IHoverService)),
|
|
220
|
-
( __param(5, INotificationService)),
|
|
221
|
-
( __param(6, ITelemetryService)),
|
|
222
|
-
( __param(7, IThemeService))
|
|
223
|
-
], StatusbarEntryItem));
|
|
233
|
+
StatusbarEntryItem = ( __decorate([( __param(3, ICommandService)), ( __param(4, IHoverService)), ( __param(5, INotificationService)), ( __param(6, ITelemetryService)), ( __param(7, IThemeService))], StatusbarEntryItem));
|
|
224
234
|
class StatusBarCodiconLabel extends SimpleIconLabel {
|
|
225
235
|
constructor(container) {
|
|
226
236
|
super(container);
|
|
227
237
|
this.container = container;
|
|
228
238
|
this.progressCodicon = renderIcon(syncing);
|
|
229
|
-
this.currentText =
|
|
239
|
+
this.currentText = "";
|
|
230
240
|
this.currentShowProgress = false;
|
|
231
241
|
}
|
|
232
242
|
set showProgress(showProgress) {
|
|
233
243
|
if (this.currentShowProgress !== showProgress) {
|
|
234
244
|
this.currentShowProgress = showProgress;
|
|
235
|
-
this.progressCodicon = renderIcon(showProgress ===
|
|
245
|
+
this.progressCodicon = renderIcon(showProgress === "syncing" ? syncing : spinningLoading);
|
|
236
246
|
this.text = this.currentText;
|
|
237
247
|
}
|
|
238
248
|
}
|
|
@@ -246,7 +256,7 @@ class StatusBarCodiconLabel extends SimpleIconLabel {
|
|
|
246
256
|
node.remove();
|
|
247
257
|
}
|
|
248
258
|
}
|
|
249
|
-
let textContent = text ??
|
|
259
|
+
let textContent = text ?? "";
|
|
250
260
|
if (textContent) {
|
|
251
261
|
textContent = `\u00A0${textContent}`;
|
|
252
262
|
}
|
|
@@ -6,8 +6,12 @@ import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode
|
|
|
6
6
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
7
7
|
|
|
8
8
|
class StatusbarViewModel extends Disposable {
|
|
9
|
-
static {
|
|
10
|
-
|
|
9
|
+
static {
|
|
10
|
+
this.HIDDEN_ENTRIES_KEY = "workbench.statusbar.hidden";
|
|
11
|
+
}
|
|
12
|
+
get entries() {
|
|
13
|
+
return this._entries.slice(0);
|
|
14
|
+
}
|
|
11
15
|
get lastFocusedEntry() {
|
|
12
16
|
return this._lastFocusedEntry && !this.isHidden(this._lastFocusedEntry.id) ? this._lastFocusedEntry : undefined;
|
|
13
17
|
}
|
|
@@ -26,13 +30,13 @@ class StatusbarViewModel extends Disposable {
|
|
|
26
30
|
if (hiddenRaw) {
|
|
27
31
|
try {
|
|
28
32
|
this.hidden = ( new Set(JSON.parse(hiddenRaw)));
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
}
|
|
33
|
+
} catch (error) {}
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
registerListeners() {
|
|
35
|
-
this._register(
|
|
37
|
+
this._register(
|
|
38
|
+
this.storageService.onDidChangeValue(StorageScope.PROFILE, StatusbarViewModel.HIDDEN_ENTRIES_KEY, this._store)(() => this.onDidStorageValueChange())
|
|
39
|
+
);
|
|
36
40
|
}
|
|
37
41
|
onDidStorageValueChange() {
|
|
38
42
|
const currentlyHidden = ( new Set(this.hidden));
|
|
@@ -111,7 +115,7 @@ class StatusbarViewModel extends Disposable {
|
|
|
111
115
|
return this._entries.find(entry => isAncestorOfActiveElement(entry.container));
|
|
112
116
|
}
|
|
113
117
|
focusEntry(delta, restartPosition) {
|
|
114
|
-
const getVisibleEntry =
|
|
118
|
+
const getVisibleEntry = start => {
|
|
115
119
|
let indexToFocus = start;
|
|
116
120
|
let entry = (indexToFocus >= 0 && indexToFocus < this._entries.length) ? this._entries[indexToFocus] : undefined;
|
|
117
121
|
while (entry && this.isHidden(entry.id)) {
|
|
@@ -136,7 +140,7 @@ class StatusbarViewModel extends Disposable {
|
|
|
136
140
|
}
|
|
137
141
|
}
|
|
138
142
|
updateVisibility(arg1, trigger) {
|
|
139
|
-
if (typeof arg1 ===
|
|
143
|
+
if (typeof arg1 === "string") {
|
|
140
144
|
const id = arg1;
|
|
141
145
|
for (const entry of this._entries) {
|
|
142
146
|
if (entry.id === id) {
|
|
@@ -149,21 +153,27 @@ class StatusbarViewModel extends Disposable {
|
|
|
149
153
|
const isHidden = this.isHidden(entry.id);
|
|
150
154
|
if (isHidden) {
|
|
151
155
|
hide(entry.container);
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
156
|
+
} else {
|
|
154
157
|
show(entry.container);
|
|
155
158
|
}
|
|
156
159
|
if (trigger) {
|
|
157
|
-
this._onDidChangeEntryVisibility.fire({
|
|
160
|
+
this._onDidChangeEntryVisibility.fire({
|
|
161
|
+
id: entry.id,
|
|
162
|
+
visible: !isHidden
|
|
163
|
+
});
|
|
158
164
|
}
|
|
159
165
|
this.markFirstLastVisibleEntry();
|
|
160
166
|
}
|
|
161
167
|
}
|
|
162
168
|
saveState() {
|
|
163
169
|
if (this.hidden.size > 0) {
|
|
164
|
-
this.storageService.store(
|
|
165
|
-
|
|
166
|
-
|
|
170
|
+
this.storageService.store(
|
|
171
|
+
StatusbarViewModel.HIDDEN_ENTRIES_KEY,
|
|
172
|
+
JSON.stringify(Array.from(( this.hidden.values()))),
|
|
173
|
+
StorageScope.PROFILE,
|
|
174
|
+
StorageTarget.USER
|
|
175
|
+
);
|
|
176
|
+
} else {
|
|
167
177
|
this.storageService.remove(StatusbarViewModel.HIDDEN_ENTRIES_KEY, StorageScope.PROFILE);
|
|
168
178
|
}
|
|
169
179
|
}
|
|
@@ -173,10 +183,9 @@ class StatusbarViewModel extends Disposable {
|
|
|
173
183
|
const mapEntryWithRelativePriority = ( new Map());
|
|
174
184
|
for (let i = 0; i < this._entries.length; i++) {
|
|
175
185
|
const entry = this._entries[i];
|
|
176
|
-
if (typeof entry.priority.primary ===
|
|
186
|
+
if (typeof entry.priority.primary === "number" || !( allEntryIds.has(entry.priority.primary.location.id))) {
|
|
177
187
|
mapEntryWithNumberedPriorityToIndex.set(entry, i);
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
188
|
+
} else {
|
|
180
189
|
const referenceEntryId = entry.priority.primary.location.id;
|
|
181
190
|
let entries = mapEntryWithRelativePriority.get(referenceEntryId);
|
|
182
191
|
if (!entries) {
|
|
@@ -197,8 +206,8 @@ class StatusbarViewModel extends Disposable {
|
|
|
197
206
|
const sortedEntriesWithNumberedPriority = Array.from(( mapEntryWithNumberedPriorityToIndex.keys()));
|
|
198
207
|
sortedEntriesWithNumberedPriority.sort((entryA, entryB) => {
|
|
199
208
|
if (entryA.alignment === entryB.alignment) {
|
|
200
|
-
const entryAPrimaryPriority = typeof entryA.priority.primary ===
|
|
201
|
-
const entryBPrimaryPriority = typeof entryB.priority.primary ===
|
|
209
|
+
const entryAPrimaryPriority = typeof entryA.priority.primary === "number" ? entryA.priority.primary : entryA.priority.primary.location.priority;
|
|
210
|
+
const entryBPrimaryPriority = typeof entryB.priority.primary === "number" ? entryB.priority.primary : entryB.priority.primary.location.priority;
|
|
202
211
|
if (entryAPrimaryPriority !== entryBPrimaryPriority) {
|
|
203
212
|
return entryBPrimaryPriority - entryAPrimaryPriority;
|
|
204
213
|
}
|
|
@@ -222,15 +231,15 @@ class StatusbarViewModel extends Disposable {
|
|
|
222
231
|
const relativeEntriesMap = mapEntryWithRelativePriority.get(entry.id);
|
|
223
232
|
const relativeEntries = relativeEntriesMap ? Array.from(( relativeEntriesMap.values())) : undefined;
|
|
224
233
|
if (relativeEntries) {
|
|
225
|
-
sortedEntries.push(...relativeEntries
|
|
226
|
-
|
|
227
|
-
|
|
234
|
+
sortedEntries.push(...relativeEntries.filter(
|
|
235
|
+
entry => isStatusbarEntryLocation(entry.priority.primary) && entry.priority.primary.alignment === StatusbarAlignment.LEFT
|
|
236
|
+
).sort((entryA, entryB) => entryB.priority.secondary - entryA.priority.secondary));
|
|
228
237
|
}
|
|
229
238
|
sortedEntries.push(entry);
|
|
230
239
|
if (relativeEntries) {
|
|
231
|
-
sortedEntries.push(...relativeEntries
|
|
232
|
-
|
|
233
|
-
|
|
240
|
+
sortedEntries.push(...relativeEntries.filter(
|
|
241
|
+
entry => isStatusbarEntryLocation(entry.priority.primary) && entry.priority.primary.alignment === StatusbarAlignment.RIGHT
|
|
242
|
+
).sort((entryA, entryB) => entryB.priority.secondary - entryA.priority.secondary));
|
|
234
243
|
}
|
|
235
244
|
mapEntryWithRelativePriority.delete(entry.id);
|
|
236
245
|
}
|
|
@@ -251,7 +260,7 @@ class StatusbarViewModel extends Disposable {
|
|
|
251
260
|
let firstVisibleItem;
|
|
252
261
|
let lastVisibleItem;
|
|
253
262
|
for (const entry of entries) {
|
|
254
|
-
entry.container.classList.remove(
|
|
263
|
+
entry.container.classList.remove("first-visible-item", "last-visible-item");
|
|
255
264
|
const isVisible = !this.isHidden(entry.id);
|
|
256
265
|
if (isVisible) {
|
|
257
266
|
if (!firstVisibleItem) {
|
|
@@ -260,8 +269,8 @@ class StatusbarViewModel extends Disposable {
|
|
|
260
269
|
lastVisibleItem = entry;
|
|
261
270
|
}
|
|
262
271
|
}
|
|
263
|
-
firstVisibleItem?.container.classList.add(
|
|
264
|
-
lastVisibleItem?.container.classList.add(
|
|
272
|
+
firstVisibleItem?.container.classList.add("first-visible-item");
|
|
273
|
+
lastVisibleItem?.container.classList.add("last-visible-item");
|
|
265
274
|
}
|
|
266
275
|
}
|
|
267
276
|
|
|
@@ -50,10 +50,25 @@ import { isManagedHoverTooltipMarkdownString, isManagedHoverTooltipHTMLElement }
|
|
|
50
50
|
var StatusbarPart_1, AuxiliaryStatusbarPart_1;
|
|
51
51
|
registerCss(statusbarpart);
|
|
52
52
|
let StatusbarPart = class StatusbarPart extends Part {
|
|
53
|
-
static {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
static {
|
|
54
|
+
StatusbarPart_1 = this;
|
|
55
|
+
}
|
|
56
|
+
static {
|
|
57
|
+
this.HEIGHT = 22;
|
|
58
|
+
}
|
|
59
|
+
constructor(
|
|
60
|
+
id,
|
|
61
|
+
instantiationService,
|
|
62
|
+
themeService,
|
|
63
|
+
contextService,
|
|
64
|
+
storageService,
|
|
65
|
+
layoutService,
|
|
66
|
+
contextMenuService,
|
|
67
|
+
contextKeyService
|
|
68
|
+
) {
|
|
69
|
+
super(id, {
|
|
70
|
+
hasTitle: false
|
|
71
|
+
}, themeService, storageService, layoutService);
|
|
57
72
|
this.instantiationService = instantiationService;
|
|
58
73
|
this.contextService = contextService;
|
|
59
74
|
this.contextMenuService = contextMenuService;
|
|
@@ -71,26 +86,25 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
71
86
|
this.styleOverrides = ( new Set());
|
|
72
87
|
this.viewModel = this._register(( new StatusbarViewModel(storageService)));
|
|
73
88
|
this.onDidChangeEntryVisibility = this.viewModel.onDidChangeEntryVisibility;
|
|
74
|
-
this.hoverDelegate = this._register(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
isHTMLElement(content) ||
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return
|
|
89
|
+
this.hoverDelegate = this._register(
|
|
90
|
+
this.instantiationService.createInstance(WorkbenchHoverDelegate, "element", {
|
|
91
|
+
instantHover: true,
|
|
92
|
+
dynamicDelay(content) {
|
|
93
|
+
if (typeof content === "function" || isHTMLElement(content) || (isManagedHoverTooltipMarkdownString(content) && typeof content.markdown === "function") || isManagedHoverTooltipHTMLElement(content)) {
|
|
94
|
+
return 500;
|
|
95
|
+
}
|
|
96
|
+
return undefined;
|
|
82
97
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
})));
|
|
98
|
+
}, (_, focus) => ({
|
|
99
|
+
persistence: {
|
|
100
|
+
hideOnKeyDown: true,
|
|
101
|
+
sticky: focus
|
|
102
|
+
},
|
|
103
|
+
appearance: {
|
|
104
|
+
maxHeightRatio: 0.9
|
|
105
|
+
}
|
|
106
|
+
}))
|
|
107
|
+
);
|
|
94
108
|
this.registerListeners();
|
|
95
109
|
}
|
|
96
110
|
registerListeners() {
|
|
@@ -111,7 +125,10 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
111
125
|
withEntryOverride(entry, id) {
|
|
112
126
|
const override = this.entryOverrides.get(id);
|
|
113
127
|
if (override) {
|
|
114
|
-
entry = {
|
|
128
|
+
entry = {
|
|
129
|
+
...entry,
|
|
130
|
+
...override
|
|
131
|
+
};
|
|
115
132
|
}
|
|
116
133
|
return entry;
|
|
117
134
|
}
|
|
@@ -119,8 +136,7 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
119
136
|
let priority;
|
|
120
137
|
if (isStatusbarEntryPriority(priorityOrLocation)) {
|
|
121
138
|
priority = priorityOrLocation;
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
139
|
+
} else {
|
|
124
140
|
priority = {
|
|
125
141
|
primary: priorityOrLocation,
|
|
126
142
|
secondary: hash(id)
|
|
@@ -132,22 +148,25 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
132
148
|
return this.doAddEntry(entry, id, alignment, priority);
|
|
133
149
|
}
|
|
134
150
|
doAddPendingEntry(entry, id, alignment, priority) {
|
|
135
|
-
const pendingEntry = {
|
|
151
|
+
const pendingEntry = {
|
|
152
|
+
entry,
|
|
153
|
+
id,
|
|
154
|
+
alignment,
|
|
155
|
+
priority
|
|
156
|
+
};
|
|
136
157
|
this.pendingEntries.push(pendingEntry);
|
|
137
158
|
const accessor = {
|
|
138
|
-
update:
|
|
159
|
+
update: entry => {
|
|
139
160
|
if (pendingEntry.accessor) {
|
|
140
161
|
pendingEntry.accessor.update(entry);
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
162
|
+
} else {
|
|
143
163
|
pendingEntry.entry = entry;
|
|
144
164
|
}
|
|
145
165
|
},
|
|
146
166
|
dispose: () => {
|
|
147
167
|
if (pendingEntry.accessor) {
|
|
148
168
|
pendingEntry.accessor.dispose();
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
169
|
+
} else {
|
|
151
170
|
this.pendingEntries = this.pendingEntries.filter(entry => entry !== pendingEntry);
|
|
152
171
|
}
|
|
153
172
|
}
|
|
@@ -157,7 +176,12 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
157
176
|
doAddEntry(entry, id, alignment, priority) {
|
|
158
177
|
const disposables = ( new DisposableStore());
|
|
159
178
|
const itemContainer = this.doCreateStatusItem(id, alignment);
|
|
160
|
-
const item = disposables.add(this.instantiationService.createInstance(
|
|
179
|
+
const item = disposables.add(this.instantiationService.createInstance(
|
|
180
|
+
StatusbarEntryItem,
|
|
181
|
+
itemContainer,
|
|
182
|
+
this.withEntryOverride(entry, id),
|
|
183
|
+
this.hoverDelegate
|
|
184
|
+
));
|
|
161
185
|
const viewModelEntry = new class {
|
|
162
186
|
constructor() {
|
|
163
187
|
this.id = id;
|
|
@@ -167,14 +191,19 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
167
191
|
this.container = itemContainer;
|
|
168
192
|
this.labelContainer = item.labelContainer;
|
|
169
193
|
}
|
|
170
|
-
get name() {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
194
|
+
get name() {
|
|
195
|
+
return item.name;
|
|
196
|
+
}
|
|
197
|
+
get hasCommand() {
|
|
198
|
+
return item.hasCommand;
|
|
199
|
+
}
|
|
200
|
+
}();
|
|
201
|
+
const {
|
|
202
|
+
needsFullRefresh
|
|
203
|
+
} = this.doAddOrRemoveModelEntry(viewModelEntry, true);
|
|
174
204
|
if (needsFullRefresh) {
|
|
175
205
|
this.appendStatusbarEntries();
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
206
|
+
} else {
|
|
178
207
|
this.appendStatusbarEntry(viewModelEntry);
|
|
179
208
|
}
|
|
180
209
|
let lastEntry = entry;
|
|
@@ -184,11 +213,12 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
184
213
|
item.update(this.withEntryOverride(entry, id));
|
|
185
214
|
},
|
|
186
215
|
dispose: () => {
|
|
187
|
-
const {
|
|
216
|
+
const {
|
|
217
|
+
needsFullRefresh
|
|
218
|
+
} = this.doAddOrRemoveModelEntry(viewModelEntry, false);
|
|
188
219
|
if (needsFullRefresh) {
|
|
189
220
|
this.appendStatusbarEntries();
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
221
|
+
} else {
|
|
192
222
|
itemContainer.remove();
|
|
193
223
|
this.updateCompactEntries();
|
|
194
224
|
}
|
|
@@ -203,15 +233,16 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
203
233
|
return accessor;
|
|
204
234
|
}
|
|
205
235
|
doCreateStatusItem(id, alignment, ...extraClasses) {
|
|
206
|
-
const itemContainer = $(
|
|
236
|
+
const itemContainer = $(".statusbar-item", {
|
|
237
|
+
id
|
|
238
|
+
});
|
|
207
239
|
if (extraClasses) {
|
|
208
240
|
itemContainer.classList.add(...extraClasses);
|
|
209
241
|
}
|
|
210
242
|
if (alignment === StatusbarAlignment.RIGHT) {
|
|
211
|
-
itemContainer.classList.add(
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
itemContainer.classList.add('left');
|
|
243
|
+
itemContainer.classList.add("right");
|
|
244
|
+
} else {
|
|
245
|
+
itemContainer.classList.add("left");
|
|
215
246
|
}
|
|
216
247
|
return itemContainer;
|
|
217
248
|
}
|
|
@@ -219,19 +250,19 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
219
250
|
const entriesBefore = this.viewModel.entries;
|
|
220
251
|
if (add) {
|
|
221
252
|
this.viewModel.add(entry);
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
253
|
+
} else {
|
|
224
254
|
this.viewModel.remove(entry);
|
|
225
255
|
}
|
|
226
256
|
const entriesAfter = this.viewModel.entries;
|
|
227
257
|
if (add) {
|
|
228
258
|
entriesBefore.splice(entriesAfter.indexOf(entry), 0, entry);
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
259
|
+
} else {
|
|
231
260
|
entriesBefore.splice(entriesBefore.indexOf(entry), 1);
|
|
232
261
|
}
|
|
233
262
|
const needsFullRefresh = !equals(entriesBefore, entriesAfter);
|
|
234
|
-
return {
|
|
263
|
+
return {
|
|
264
|
+
needsFullRefresh
|
|
265
|
+
};
|
|
235
266
|
}
|
|
236
267
|
isEntryVisible(id) {
|
|
237
268
|
return !this.viewModel.isHidden(id);
|
|
@@ -239,8 +270,7 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
239
270
|
updateEntryVisibility(id, visible) {
|
|
240
271
|
if (visible) {
|
|
241
272
|
this.viewModel.show(id);
|
|
242
|
-
}
|
|
243
|
-
else {
|
|
273
|
+
} else {
|
|
244
274
|
this.viewModel.hide(id);
|
|
245
275
|
}
|
|
246
276
|
}
|
|
@@ -264,14 +294,18 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
264
294
|
this.element = parent;
|
|
265
295
|
const scopedContextKeyService = this._register(this.contextKeyService.createScoped(this.element));
|
|
266
296
|
StatusBarFocused.bindTo(scopedContextKeyService).set(true);
|
|
267
|
-
this.leftItemsContainer = $(
|
|
297
|
+
this.leftItemsContainer = $(".left-items.items-container");
|
|
268
298
|
this.element.appendChild(this.leftItemsContainer);
|
|
269
299
|
this.element.tabIndex = 0;
|
|
270
|
-
this.rightItemsContainer = $(
|
|
300
|
+
this.rightItemsContainer = $(".right-items.items-container");
|
|
271
301
|
this.element.appendChild(this.rightItemsContainer);
|
|
272
|
-
this._register(
|
|
302
|
+
this._register(
|
|
303
|
+
addDisposableListener(parent, EventType.CONTEXT_MENU, e => this.showContextMenu(e))
|
|
304
|
+
);
|
|
273
305
|
this._register(Gesture.addTarget(parent));
|
|
274
|
-
this._register(
|
|
306
|
+
this._register(
|
|
307
|
+
addDisposableListener(parent, EventType$1.Contextmenu, e => this.showContextMenu(e))
|
|
308
|
+
);
|
|
275
309
|
this.createInitialStatusbarEntries();
|
|
276
310
|
return this.element;
|
|
277
311
|
}
|
|
@@ -303,12 +337,13 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
303
337
|
if (entry.alignment === StatusbarAlignment.RIGHT) {
|
|
304
338
|
entries.reverse();
|
|
305
339
|
}
|
|
306
|
-
const target = assertReturnsDefined(
|
|
340
|
+
const target = assertReturnsDefined(
|
|
341
|
+
entry.alignment === StatusbarAlignment.LEFT ? this.leftItemsContainer : this.rightItemsContainer
|
|
342
|
+
);
|
|
307
343
|
const index = entries.indexOf(entry);
|
|
308
344
|
if (index + 1 === entries.length) {
|
|
309
345
|
target.appendChild(entry.container);
|
|
310
|
-
}
|
|
311
|
-
else {
|
|
346
|
+
} else {
|
|
312
347
|
target.insertBefore(entry.container, entries[index + 1].container);
|
|
313
348
|
}
|
|
314
349
|
this.updateCompactEntries();
|
|
@@ -320,13 +355,12 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
320
355
|
if (!this.viewModel.isHidden(entry.id)) {
|
|
321
356
|
mapIdToVisibleEntry.set(entry.id, entry);
|
|
322
357
|
}
|
|
323
|
-
entry.container.classList.remove(
|
|
358
|
+
entry.container.classList.remove("compact-left", "compact-right");
|
|
324
359
|
}
|
|
325
360
|
const compactEntryGroups = ( new Map());
|
|
326
361
|
for (const entry of ( mapIdToVisibleEntry.values())) {
|
|
327
|
-
if (
|
|
328
|
-
|
|
329
|
-
) {
|
|
362
|
+
if (
|
|
363
|
+
isStatusbarEntryLocation(entry.priority.primary) && entry.priority.primary.compact) {
|
|
330
364
|
const locationId = entry.priority.primary.location.id;
|
|
331
365
|
const location = mapIdToVisibleEntry.get(locationId);
|
|
332
366
|
if (!location) {
|
|
@@ -348,12 +382,11 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
348
382
|
compactEntryGroup.set(entry.id, entry);
|
|
349
383
|
compactEntryGroup.set(location.id, location);
|
|
350
384
|
if (entry.priority.primary.alignment === StatusbarAlignment.LEFT) {
|
|
351
|
-
location.container.classList.add(
|
|
352
|
-
entry.container.classList.add(
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
entry.container.classList.add('compact-left');
|
|
385
|
+
location.container.classList.add("compact-left");
|
|
386
|
+
entry.container.classList.add("compact-right");
|
|
387
|
+
} else {
|
|
388
|
+
location.container.classList.add("compact-right");
|
|
389
|
+
entry.container.classList.add("compact-left");
|
|
357
390
|
}
|
|
358
391
|
}
|
|
359
392
|
}
|
|
@@ -366,13 +399,19 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
366
399
|
if (!compactEntry.hasCommand) {
|
|
367
400
|
continue;
|
|
368
401
|
}
|
|
369
|
-
this.compactEntriesDisposable.value.add(
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
402
|
+
this.compactEntriesDisposable.value.add(
|
|
403
|
+
addDisposableListener(compactEntry.labelContainer, EventType.MOUSE_OVER, () => {
|
|
404
|
+
compactEntryGroup.forEach(
|
|
405
|
+
compactEntry => compactEntry.labelContainer.style.backgroundColor = statusBarItemHoverBackground
|
|
406
|
+
);
|
|
407
|
+
compactEntry.labelContainer.style.backgroundColor = statusBarItemCompactHoverBackground;
|
|
408
|
+
})
|
|
409
|
+
);
|
|
410
|
+
this.compactEntriesDisposable.value.add(
|
|
411
|
+
addDisposableListener(compactEntry.labelContainer, EventType.MOUSE_OUT, () => {
|
|
412
|
+
compactEntryGroup.forEach(compactEntry => compactEntry.labelContainer.style.backgroundColor = "");
|
|
413
|
+
})
|
|
414
|
+
);
|
|
376
415
|
}
|
|
377
416
|
}
|
|
378
417
|
}
|
|
@@ -396,7 +435,11 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
396
435
|
}
|
|
397
436
|
getContextMenuActions(event) {
|
|
398
437
|
const actions = [];
|
|
399
|
-
actions.push(toAction({
|
|
438
|
+
actions.push(toAction({
|
|
439
|
+
id: ToggleStatusbarVisibilityAction.ID,
|
|
440
|
+
label: ( localize(3648, "Hide Status Bar")),
|
|
441
|
+
run: () => this.instantiationService.invokeFunction(accessor => ( new ToggleStatusbarVisibilityAction()).run(accessor))
|
|
442
|
+
}));
|
|
400
443
|
actions.push(( new Separator()));
|
|
401
444
|
const handledEntries = ( new Set());
|
|
402
445
|
for (const entry of this.viewModel.entries) {
|
|
@@ -416,7 +459,9 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
416
459
|
if (statusEntryUnderMouse) {
|
|
417
460
|
actions.push(( new Separator()));
|
|
418
461
|
if (statusEntryUnderMouse.extensionId) {
|
|
419
|
-
actions.push(
|
|
462
|
+
actions.push(
|
|
463
|
+
this.instantiationService.createInstance(ManageExtensionAction, statusEntryUnderMouse.extensionId)
|
|
464
|
+
);
|
|
420
465
|
}
|
|
421
466
|
actions.push(( new HideStatusbarEntryAction(statusEntryUnderMouse.id, statusEntryUnderMouse.name, this.viewModel)));
|
|
422
467
|
}
|
|
@@ -426,19 +471,25 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
426
471
|
super.updateStyles();
|
|
427
472
|
const container = assertReturnsDefined(this.getContainer());
|
|
428
473
|
const styleOverride = [...this.styleOverrides].sort((a, b) => a.priority - b.priority)[0];
|
|
429
|
-
const backgroundColor = this.getColor(
|
|
474
|
+
const backgroundColor = this.getColor(
|
|
475
|
+
styleOverride?.background ?? (this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY ? STATUS_BAR_BACKGROUND : STATUS_BAR_NO_FOLDER_BACKGROUND)
|
|
476
|
+
) || "";
|
|
430
477
|
container.style.backgroundColor = backgroundColor;
|
|
431
|
-
const foregroundColor = this.getColor(
|
|
478
|
+
const foregroundColor = this.getColor(
|
|
479
|
+
styleOverride?.foreground ?? (this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY ? STATUS_BAR_FOREGROUND : STATUS_BAR_NO_FOLDER_FOREGROUND)
|
|
480
|
+
) || "";
|
|
432
481
|
container.style.color = foregroundColor;
|
|
433
482
|
const itemBorderColor = this.getColor(STATUS_BAR_ITEM_FOCUS_BORDER);
|
|
434
|
-
|
|
483
|
+
this.updateCompactEntries();
|
|
484
|
+
const borderColor = this.getColor(
|
|
485
|
+
styleOverride?.border ?? (this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY ? STATUS_BAR_BORDER : STATUS_BAR_NO_FOLDER_BORDER)
|
|
486
|
+
) || this.getColor(contrastBorder);
|
|
435
487
|
if (borderColor) {
|
|
436
|
-
container.classList.add(
|
|
437
|
-
container.style.setProperty(
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
container.
|
|
441
|
-
container.style.removeProperty('--status-border-top-color');
|
|
488
|
+
container.classList.add("status-border-top");
|
|
489
|
+
container.style.setProperty("--status-border-top-color", borderColor);
|
|
490
|
+
} else {
|
|
491
|
+
container.classList.remove("status-border-top");
|
|
492
|
+
container.style.removeProperty("--status-border-top-color");
|
|
442
493
|
}
|
|
443
494
|
const statusBarFocusColor = this.getColor(STATUS_BAR_FOCUS_BORDER);
|
|
444
495
|
if (!this.styleElement) {
|
|
@@ -446,22 +497,22 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
446
497
|
}
|
|
447
498
|
this.styleElement.textContent = `
|
|
448
499
|
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
500
|
+
/* Status bar focus outline */
|
|
501
|
+
.monaco-workbench .part.statusbar:focus {
|
|
502
|
+
outline-color: ${statusBarFocusColor};
|
|
503
|
+
}
|
|
453
504
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
505
|
+
/* Status bar item focus outline */
|
|
506
|
+
.monaco-workbench .part.statusbar > .items-container > .statusbar-item a:focus-visible {
|
|
507
|
+
outline: 1px solid ${this.getColor(activeContrastBorder) ?? itemBorderColor};
|
|
508
|
+
outline-offset: ${borderColor ? "-2px" : "-1px"};
|
|
509
|
+
}
|
|
459
510
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
511
|
+
/* Notification Beak */
|
|
512
|
+
.monaco-workbench .part.statusbar > .items-container > .statusbar-item.has-beak > .status-bar-item-beak-container:before {
|
|
513
|
+
border-bottom-color: ${borderColor ?? backgroundColor};
|
|
514
|
+
}
|
|
515
|
+
`;
|
|
465
516
|
}
|
|
466
517
|
layout(width, height, top, left) {
|
|
467
518
|
super.layout(width, height, top, left);
|
|
@@ -485,51 +536,66 @@ let StatusbarPart = class StatusbarPart extends Part {
|
|
|
485
536
|
super.dispose();
|
|
486
537
|
}
|
|
487
538
|
};
|
|
488
|
-
StatusbarPart = StatusbarPart_1 = ( __decorate([
|
|
489
|
-
( __param(1, IInstantiationService)),
|
|
490
|
-
( __param(2, IThemeService)),
|
|
491
|
-
( __param(3, IWorkspaceContextService)),
|
|
492
|
-
( __param(4, IStorageService)),
|
|
493
|
-
( __param(5, IWorkbenchLayoutService)),
|
|
494
|
-
( __param(6, IContextMenuService)),
|
|
495
|
-
( __param(7, IContextKeyService))
|
|
496
|
-
], StatusbarPart));
|
|
539
|
+
StatusbarPart = StatusbarPart_1 = ( __decorate([( __param(1, IInstantiationService)), ( __param(2, IThemeService)), ( __param(3, IWorkspaceContextService)), ( __param(4, IStorageService)), ( __param(5, IWorkbenchLayoutService)), ( __param(6, IContextMenuService)), ( __param(7, IContextKeyService))], StatusbarPart));
|
|
497
540
|
let MainStatusbarPart = class MainStatusbarPart extends StatusbarPart {
|
|
498
|
-
constructor(
|
|
499
|
-
|
|
541
|
+
constructor(
|
|
542
|
+
instantiationService,
|
|
543
|
+
themeService,
|
|
544
|
+
contextService,
|
|
545
|
+
storageService,
|
|
546
|
+
layoutService,
|
|
547
|
+
contextMenuService,
|
|
548
|
+
contextKeyService
|
|
549
|
+
) {
|
|
550
|
+
super(
|
|
551
|
+
Parts.STATUSBAR_PART,
|
|
552
|
+
instantiationService,
|
|
553
|
+
themeService,
|
|
554
|
+
contextService,
|
|
555
|
+
storageService,
|
|
556
|
+
layoutService,
|
|
557
|
+
contextMenuService,
|
|
558
|
+
contextKeyService
|
|
559
|
+
);
|
|
500
560
|
}
|
|
501
561
|
};
|
|
502
|
-
MainStatusbarPart = ( __decorate([
|
|
503
|
-
( __param(0, IInstantiationService)),
|
|
504
|
-
( __param(1, IThemeService)),
|
|
505
|
-
( __param(2, IWorkspaceContextService)),
|
|
506
|
-
( __param(3, IStorageService)),
|
|
507
|
-
( __param(4, IWorkbenchLayoutService)),
|
|
508
|
-
( __param(5, IContextMenuService)),
|
|
509
|
-
( __param(6, IContextKeyService))
|
|
510
|
-
], MainStatusbarPart));
|
|
562
|
+
MainStatusbarPart = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, IThemeService)), ( __param(2, IWorkspaceContextService)), ( __param(3, IStorageService)), ( __param(4, IWorkbenchLayoutService)), ( __param(5, IContextMenuService)), ( __param(6, IContextKeyService))], MainStatusbarPart));
|
|
511
563
|
let AuxiliaryStatusbarPart = class AuxiliaryStatusbarPart extends StatusbarPart {
|
|
512
|
-
static {
|
|
513
|
-
|
|
514
|
-
|
|
564
|
+
static {
|
|
565
|
+
AuxiliaryStatusbarPart_1 = this;
|
|
566
|
+
}
|
|
567
|
+
static {
|
|
568
|
+
this.COUNTER = 1;
|
|
569
|
+
}
|
|
570
|
+
constructor(
|
|
571
|
+
container,
|
|
572
|
+
instantiationService,
|
|
573
|
+
themeService,
|
|
574
|
+
contextService,
|
|
575
|
+
storageService,
|
|
576
|
+
layoutService,
|
|
577
|
+
contextMenuService,
|
|
578
|
+
contextKeyService
|
|
579
|
+
) {
|
|
515
580
|
const id = AuxiliaryStatusbarPart_1.COUNTER++;
|
|
516
|
-
super(
|
|
581
|
+
super(
|
|
582
|
+
`workbench.parts.auxiliaryStatus.${id}`,
|
|
583
|
+
instantiationService,
|
|
584
|
+
themeService,
|
|
585
|
+
contextService,
|
|
586
|
+
storageService,
|
|
587
|
+
layoutService,
|
|
588
|
+
contextMenuService,
|
|
589
|
+
contextKeyService
|
|
590
|
+
);
|
|
517
591
|
this.container = container;
|
|
518
592
|
this.height = StatusbarPart.HEIGHT;
|
|
519
593
|
}
|
|
520
594
|
};
|
|
521
|
-
AuxiliaryStatusbarPart = AuxiliaryStatusbarPart_1 = ( __decorate([
|
|
522
|
-
( __param(1, IInstantiationService)),
|
|
523
|
-
( __param(2, IThemeService)),
|
|
524
|
-
( __param(3, IWorkspaceContextService)),
|
|
525
|
-
( __param(4, IStorageService)),
|
|
526
|
-
( __param(5, IWorkbenchLayoutService)),
|
|
527
|
-
( __param(6, IContextMenuService)),
|
|
528
|
-
( __param(7, IContextKeyService))
|
|
529
|
-
], AuxiliaryStatusbarPart));
|
|
595
|
+
AuxiliaryStatusbarPart = AuxiliaryStatusbarPart_1 = ( __decorate([( __param(1, IInstantiationService)), ( __param(2, IThemeService)), ( __param(3, IWorkspaceContextService)), ( __param(4, IStorageService)), ( __param(5, IWorkbenchLayoutService)), ( __param(6, IContextMenuService)), ( __param(7, IContextKeyService))], AuxiliaryStatusbarPart));
|
|
530
596
|
let StatusbarService = class StatusbarService extends MultiWindowParts {
|
|
531
597
|
constructor(instantiationService, storageService, themeService) {
|
|
532
|
-
super(
|
|
598
|
+
super("workbench.statusBarService", themeService, storageService);
|
|
533
599
|
this.instantiationService = instantiationService;
|
|
534
600
|
this._onDidCreateAuxiliaryStatusbarPart = this._register(( new Emitter()));
|
|
535
601
|
this.onDidCreateAuxiliaryStatusbarPart = this._onDidCreateAuxiliaryStatusbarPart.event;
|
|
@@ -538,12 +604,12 @@ let StatusbarService = class StatusbarService extends MultiWindowParts {
|
|
|
538
604
|
this.onDidChangeEntryVisibility = this.mainPart.onDidChangeEntryVisibility;
|
|
539
605
|
}
|
|
540
606
|
createAuxiliaryStatusbarPart(container, instantiationService) {
|
|
541
|
-
const statusbarPartContainer = $(
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
607
|
+
const statusbarPartContainer = $("footer.part.statusbar", {
|
|
608
|
+
"role": "status",
|
|
609
|
+
"aria-live": "off",
|
|
610
|
+
"tabIndex": "0"
|
|
545
611
|
});
|
|
546
|
-
statusbarPartContainer.style.position =
|
|
612
|
+
statusbarPartContainer.style.position = "relative";
|
|
547
613
|
container.appendChild(statusbarPartContainer);
|
|
548
614
|
const statusbarPart = instantiationService.createInstance(AuxiliaryStatusbarPart, statusbarPartContainer);
|
|
549
615
|
const disposable = this.registerPart(statusbarPart);
|
|
@@ -553,7 +619,9 @@ let StatusbarService = class StatusbarService extends MultiWindowParts {
|
|
|
553
619
|
return statusbarPart;
|
|
554
620
|
}
|
|
555
621
|
createScoped(statusbarEntryContainer, disposables) {
|
|
556
|
-
return disposables.add(
|
|
622
|
+
return disposables.add(
|
|
623
|
+
this.instantiationService.createInstance(ScopedStatusbarService, statusbarEntryContainer)
|
|
624
|
+
);
|
|
557
625
|
}
|
|
558
626
|
addEntry(entry, id, alignment, priorityOrLocation = 0) {
|
|
559
627
|
if (entry.showInAllWindows) {
|
|
@@ -579,7 +647,7 @@ let StatusbarService = class StatusbarService extends MultiWindowParts {
|
|
|
579
647
|
}
|
|
580
648
|
entryDisposables.add(this.onDidCreateAuxiliaryStatusbarPart(part => addEntry(part)));
|
|
581
649
|
return {
|
|
582
|
-
update:
|
|
650
|
+
update: updatedEntry => {
|
|
583
651
|
entry = updatedEntry;
|
|
584
652
|
for (const update of accessors) {
|
|
585
653
|
update.update(updatedEntry);
|
|
@@ -623,11 +691,7 @@ let StatusbarService = class StatusbarService extends MultiWindowParts {
|
|
|
623
691
|
return disposables;
|
|
624
692
|
}
|
|
625
693
|
};
|
|
626
|
-
StatusbarService = ( __decorate([
|
|
627
|
-
( __param(0, IInstantiationService)),
|
|
628
|
-
( __param(1, IStorageService)),
|
|
629
|
-
( __param(2, IThemeService))
|
|
630
|
-
], StatusbarService));
|
|
694
|
+
StatusbarService = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, IStorageService)), ( __param(2, IThemeService))], StatusbarService));
|
|
631
695
|
let ScopedStatusbarService = class ScopedStatusbarService extends Disposable {
|
|
632
696
|
constructor(statusbarEntryContainer, statusbarService) {
|
|
633
697
|
super();
|
|
@@ -672,8 +736,6 @@ let ScopedStatusbarService = class ScopedStatusbarService extends Disposable {
|
|
|
672
736
|
return this.statusbarEntryContainer.overrideStyle(style);
|
|
673
737
|
}
|
|
674
738
|
};
|
|
675
|
-
ScopedStatusbarService = ( __decorate([
|
|
676
|
-
( __param(1, IStatusbarService))
|
|
677
|
-
], ScopedStatusbarService));
|
|
739
|
+
ScopedStatusbarService = ( __decorate([( __param(1, IStatusbarService))], ScopedStatusbarService));
|
|
678
740
|
|
|
679
741
|
export { AuxiliaryStatusbarPart, MainStatusbarPart, ScopedStatusbarService, StatusbarService };
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { DisposableStore, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
5
|
-
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
6
|
-
import { isProposedApiEnabled } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions';
|
|
7
|
-
import { ExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
|
|
8
|
-
import { isAccessibilityInformation } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility';
|
|
9
|
-
import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
|
|
10
|
-
import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
|
|
11
|
-
import { asStatusBarItemIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHostTypes';
|
|
12
|
-
import { registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
|
|
13
|
-
import { StatusBarUpdateKind, IExtensionStatusBarItemService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/browser/statusBarService';
|
|
14
|
-
|
|
15
|
-
function isUserFriendlyStatusItemEntry(candidate) {
|
|
16
|
-
const obj = candidate;
|
|
17
|
-
return (typeof obj.id === 'string' && obj.id.length > 0)
|
|
18
|
-
&& typeof obj.name === 'string'
|
|
19
|
-
&& typeof obj.text === 'string'
|
|
20
|
-
&& (obj.alignment === 'left' || obj.alignment === 'right')
|
|
21
|
-
&& (obj.command === undefined || typeof obj.command === 'string')
|
|
22
|
-
&& (obj.tooltip === undefined || typeof obj.tooltip === 'string')
|
|
23
|
-
&& (obj.priority === undefined || typeof obj.priority === 'number')
|
|
24
|
-
&& (obj.accessibilityInformation === undefined || isAccessibilityInformation(obj.accessibilityInformation));
|
|
25
|
-
}
|
|
26
|
-
const statusBarItemSchema = {
|
|
27
|
-
type: 'object',
|
|
28
|
-
required: ['id', 'text', 'alignment', 'name'],
|
|
29
|
-
properties: {
|
|
30
|
-
id: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
markdownDescription: ( localize(
|
|
33
|
-
2564,
|
|
34
|
-
'The identifier of the status bar entry. Must be unique within the extension. The same value must be used when calling the `vscode.window.createStatusBarItem(id, ...)`-API'
|
|
35
|
-
))
|
|
36
|
-
},
|
|
37
|
-
name: {
|
|
38
|
-
type: 'string',
|
|
39
|
-
description: ( localize(
|
|
40
|
-
2565,
|
|
41
|
-
'The name of the entry, like \'Python Language Indicator\', \'Git Status\' etc. Try to keep the length of the name short, yet descriptive enough that users can understand what the status bar item is about.'
|
|
42
|
-
))
|
|
43
|
-
},
|
|
44
|
-
text: {
|
|
45
|
-
type: 'string',
|
|
46
|
-
description: ( localize(
|
|
47
|
-
2566,
|
|
48
|
-
'The text to show for the entry. You can embed icons in the text by leveraging the `$(<name>)`-syntax, like \'Hello $(globe)!\''
|
|
49
|
-
))
|
|
50
|
-
},
|
|
51
|
-
tooltip: {
|
|
52
|
-
type: 'string',
|
|
53
|
-
description: ( localize(2567, 'The tooltip text for the entry.'))
|
|
54
|
-
},
|
|
55
|
-
command: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: ( localize(2568, 'The command to execute when the status bar entry is clicked.'))
|
|
58
|
-
},
|
|
59
|
-
alignment: {
|
|
60
|
-
type: 'string',
|
|
61
|
-
enum: ['left', 'right'],
|
|
62
|
-
description: ( localize(2569, 'The alignment of the status bar entry.'))
|
|
63
|
-
},
|
|
64
|
-
priority: {
|
|
65
|
-
type: 'number',
|
|
66
|
-
description: ( localize(
|
|
67
|
-
2570,
|
|
68
|
-
'The priority of the status bar entry. Higher value means the item should be shown more to the left.'
|
|
69
|
-
))
|
|
70
|
-
},
|
|
71
|
-
accessibilityInformation: {
|
|
72
|
-
type: 'object',
|
|
73
|
-
description: ( localize(
|
|
74
|
-
2571,
|
|
75
|
-
'Defines the role and aria label to be used when the status bar entry is focused.'
|
|
76
|
-
)),
|
|
77
|
-
required: ['label'],
|
|
78
|
-
properties: {
|
|
79
|
-
role: {
|
|
80
|
-
type: 'string',
|
|
81
|
-
description: ( localize(
|
|
82
|
-
2572,
|
|
83
|
-
'The role of the status bar entry which defines how a screen reader interacts with it. More about aria roles can be found here https://w3c.github.io/aria/#widget_roles'
|
|
84
|
-
))
|
|
85
|
-
},
|
|
86
|
-
label: {
|
|
87
|
-
type: 'string',
|
|
88
|
-
description: ( localize(
|
|
89
|
-
2573,
|
|
90
|
-
'The aria label of the status bar entry. Defaults to the entry\'s text.'
|
|
91
|
-
))
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const statusBarItemsSchema = {
|
|
98
|
-
description: ( localize(2574, "Contributes items to the status bar.")),
|
|
99
|
-
oneOf: [
|
|
100
|
-
statusBarItemSchema,
|
|
101
|
-
{
|
|
102
|
-
type: 'array',
|
|
103
|
-
items: statusBarItemSchema
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
};
|
|
107
|
-
const statusBarItemsExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
108
|
-
extensionPoint: 'statusBarItems',
|
|
109
|
-
jsonSchema: statusBarItemsSchema,
|
|
110
|
-
});
|
|
111
|
-
let StatusBarItemsExtensionPoint = class StatusBarItemsExtensionPoint {
|
|
112
|
-
constructor(statusBarItemsService) {
|
|
113
|
-
const contributions = ( new DisposableStore());
|
|
114
|
-
statusBarItemsExtensionPoint.setHandler((extensions) => {
|
|
115
|
-
contributions.clear();
|
|
116
|
-
for (const entry of extensions) {
|
|
117
|
-
if (!isProposedApiEnabled(entry.description, 'contribStatusBarItems')) {
|
|
118
|
-
entry.collector.error(`The ${statusBarItemsExtensionPoint.name} is proposed API`);
|
|
119
|
-
continue;
|
|
120
|
-
}
|
|
121
|
-
const { value, collector } = entry;
|
|
122
|
-
for (const candidate of Iterable.wrap(value)) {
|
|
123
|
-
if (!isUserFriendlyStatusItemEntry(candidate)) {
|
|
124
|
-
collector.error(( localize(2575, "Invalid status bar item contribution.")));
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
const fullItemId = asStatusBarItemIdentifier(entry.description.identifier, candidate.id);
|
|
128
|
-
const kind = statusBarItemsService.setOrUpdateEntry(fullItemId, fullItemId, ExtensionIdentifier.toKey(entry.description.identifier), candidate.name ?? entry.description.displayName ?? entry.description.name, candidate.text, candidate.tooltip, candidate.command ? { id: candidate.command, title: candidate.name } : undefined, undefined, undefined, candidate.alignment === 'left', candidate.priority, candidate.accessibilityInformation);
|
|
129
|
-
if (kind === StatusBarUpdateKind.DidDefine) {
|
|
130
|
-
contributions.add(toDisposable(() => statusBarItemsService.unsetEntry(fullItemId)));
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
StatusBarItemsExtensionPoint = ( __decorate([
|
|
138
|
-
( __param(0, IExtensionStatusBarItemService))
|
|
139
|
-
], StatusBarItemsExtensionPoint));
|
|
140
|
-
let StatusBarItemsExtensionPointWorkbenchContribution = class StatusBarItemsExtensionPointWorkbenchContribution {
|
|
141
|
-
static { this.ID = 'workbench.contrib.statusBarItemsExtensionPoint'; }
|
|
142
|
-
constructor(instantiationService) {
|
|
143
|
-
this.instantiationService = instantiationService;
|
|
144
|
-
this.instantiationService.createInstance(StatusBarItemsExtensionPoint);
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
StatusBarItemsExtensionPointWorkbenchContribution = ( __decorate([
|
|
148
|
-
( __param(0, IInstantiationService))
|
|
149
|
-
], StatusBarItemsExtensionPointWorkbenchContribution));
|
|
150
|
-
registerWorkbenchContribution2(StatusBarItemsExtensionPointWorkbenchContribution.ID, StatusBarItemsExtensionPointWorkbenchContribution, WorkbenchPhase.BlockStartup);
|
|
151
|
-
|
|
152
|
-
export { StatusBarItemsExtensionPoint };
|