@codingame/monaco-vscode-timeline-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/workbench/contrib/localHistory/browser/localHistory.js +4 -11
- package/vscode/src/vs/workbench/contrib/localHistory/browser/localHistoryCommands.js +51 -150
- package/vscode/src/vs/workbench/contrib/localHistory/browser/localHistoryFileSystemProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/localHistory/browser/localHistoryTimeline.js +18 -21
- package/vscode/src/vs/workbench/contrib/timeline/browser/timeline.contribution.js +21 -40
- package/vscode/src/vs/workbench/contrib/timeline/browser/timelinePane.js +112 -179
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-timeline-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
|
}
|
|
@@ -4,6 +4,7 @@ import { language } from 'vscode/vscode/vs/base/common/platform';
|
|
|
4
4
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
5
5
|
import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
6
6
|
|
|
7
|
+
const _moduleId = "vs/workbench/contrib/localHistory/browser/localHistory";
|
|
7
8
|
let localHistoryDateFormatter = undefined;
|
|
8
9
|
function getLocalHistoryDateFormatter() {
|
|
9
10
|
if (!localHistoryDateFormatter) {
|
|
@@ -22,16 +23,8 @@ function getLocalHistoryDateFormatter() {
|
|
|
22
23
|
return localHistoryDateFormatter;
|
|
23
24
|
}
|
|
24
25
|
const LOCAL_HISTORY_MENU_CONTEXT_VALUE = 'localHistory:item';
|
|
25
|
-
const LOCAL_HISTORY_MENU_CONTEXT_KEY = ( ContextKeyExpr.equals('timelineItem', LOCAL_HISTORY_MENU_CONTEXT_VALUE));
|
|
26
|
-
const LOCAL_HISTORY_ICON_ENTRY = registerIcon('localHistory-icon', Codicon.circleOutline, ( localizeWithPath(
|
|
27
|
-
|
|
28
|
-
'localHistoryIcon',
|
|
29
|
-
"Icon for a local history entry in the timeline view."
|
|
30
|
-
)));
|
|
31
|
-
const LOCAL_HISTORY_ICON_RESTORE = registerIcon('localHistory-restore', Codicon.check, ( localizeWithPath(
|
|
32
|
-
'vs/workbench/contrib/localHistory/browser/localHistory',
|
|
33
|
-
'localHistoryRestore',
|
|
34
|
-
"Icon for restoring contents of a local history entry."
|
|
35
|
-
)));
|
|
26
|
+
const LOCAL_HISTORY_MENU_CONTEXT_KEY = ( (ContextKeyExpr.equals('timelineItem', LOCAL_HISTORY_MENU_CONTEXT_VALUE)));
|
|
27
|
+
const LOCAL_HISTORY_ICON_ENTRY = registerIcon('localHistory-icon', Codicon.circleOutline, ( localizeWithPath(_moduleId, 0, "Icon for a local history entry in the timeline view.")));
|
|
28
|
+
const LOCAL_HISTORY_ICON_RESTORE = registerIcon('localHistory-restore', Codicon.check, ( localizeWithPath(_moduleId, 1, "Icon for restoring contents of a local history entry.")));
|
|
36
29
|
|
|
37
30
|
export { LOCAL_HISTORY_ICON_ENTRY, LOCAL_HISTORY_ICON_RESTORE, LOCAL_HISTORY_MENU_CONTEXT_KEY, LOCAL_HISTORY_MENU_CONTEXT_VALUE, getLocalHistoryDateFormatter };
|
|
@@ -27,16 +27,9 @@ import { firstOrDefault } from 'vscode/vscode/vs/base/common/arrays';
|
|
|
27
27
|
import { LOCAL_HISTORY_MENU_CONTEXT_KEY, LOCAL_HISTORY_ICON_RESTORE, getLocalHistoryDateFormatter } from './localHistory.js';
|
|
28
28
|
import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService.service';
|
|
29
29
|
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'Local History'
|
|
34
|
-
));
|
|
35
|
-
const COMPARE_WITH_FILE_LABEL = ( localize2WithPath(
|
|
36
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
37
|
-
'localHistory.compareWithFile',
|
|
38
|
-
'Compare with File'
|
|
39
|
-
));
|
|
30
|
+
const _moduleId = "vs/workbench/contrib/localHistory/browser/localHistoryCommands";
|
|
31
|
+
const LOCAL_HISTORY_CATEGORY = ( localize2WithPath(_moduleId, 0, 'Local History'));
|
|
32
|
+
const COMPARE_WITH_FILE_LABEL = ( localize2WithPath(_moduleId, 1, 'Compare with File'));
|
|
40
33
|
registerAction2(class extends Action2 {
|
|
41
34
|
constructor() {
|
|
42
35
|
super({
|
|
@@ -63,11 +56,7 @@ registerAction2(class extends Action2 {
|
|
|
63
56
|
constructor() {
|
|
64
57
|
super({
|
|
65
58
|
id: 'workbench.action.localHistory.compareWithPrevious',
|
|
66
|
-
title: ( localize2WithPath(
|
|
67
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
68
|
-
'localHistory.compareWithPrevious',
|
|
69
|
-
'Compare with Previous'
|
|
70
|
-
)),
|
|
59
|
+
title: ( localize2WithPath(_moduleId, 2, 'Compare with Previous')),
|
|
71
60
|
menu: {
|
|
72
61
|
id: MenuId.TimelineItemContext,
|
|
73
62
|
group: '1_compare',
|
|
@@ -90,16 +79,12 @@ registerAction2(class extends Action2 {
|
|
|
90
79
|
}
|
|
91
80
|
});
|
|
92
81
|
let itemSelectedForCompare = undefined;
|
|
93
|
-
const LocalHistoryItemSelectedForCompare = ( new RawContextKey('localHistoryItemSelectedForCompare', false, true));
|
|
82
|
+
const LocalHistoryItemSelectedForCompare = ( (new RawContextKey('localHistoryItemSelectedForCompare', false, true)));
|
|
94
83
|
registerAction2(class extends Action2 {
|
|
95
84
|
constructor() {
|
|
96
85
|
super({
|
|
97
86
|
id: 'workbench.action.localHistory.selectForCompare',
|
|
98
|
-
title: ( localize2WithPath(
|
|
99
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
100
|
-
'localHistory.selectForCompare',
|
|
101
|
-
'Select for Compare'
|
|
102
|
-
)),
|
|
87
|
+
title: ( localize2WithPath(_moduleId, 3, 'Select for Compare')),
|
|
103
88
|
menu: {
|
|
104
89
|
id: MenuId.TimelineItemContext,
|
|
105
90
|
group: '2_compare_with',
|
|
@@ -122,16 +107,12 @@ registerAction2(class extends Action2 {
|
|
|
122
107
|
constructor() {
|
|
123
108
|
super({
|
|
124
109
|
id: 'workbench.action.localHistory.compareWithSelected',
|
|
125
|
-
title: ( localize2WithPath(
|
|
126
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
127
|
-
'localHistory.compareWithSelected',
|
|
128
|
-
'Compare with Selected'
|
|
129
|
-
)),
|
|
110
|
+
title: ( localize2WithPath(_moduleId, 4, 'Compare with Selected')),
|
|
130
111
|
menu: {
|
|
131
112
|
id: MenuId.TimelineItemContext,
|
|
132
113
|
group: '2_compare_with',
|
|
133
114
|
order: 1,
|
|
134
|
-
when: ( ContextKeyExpr.and(LOCAL_HISTORY_MENU_CONTEXT_KEY, LocalHistoryItemSelectedForCompare))
|
|
115
|
+
when: ( (ContextKeyExpr.and(LOCAL_HISTORY_MENU_CONTEXT_KEY, LocalHistoryItemSelectedForCompare)))
|
|
135
116
|
}
|
|
136
117
|
});
|
|
137
118
|
}
|
|
@@ -155,11 +136,7 @@ registerAction2(class extends Action2 {
|
|
|
155
136
|
constructor() {
|
|
156
137
|
super({
|
|
157
138
|
id: 'workbench.action.localHistory.open',
|
|
158
|
-
title: ( localize2WithPath(
|
|
159
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
160
|
-
'localHistory.open',
|
|
161
|
-
'Show Contents'
|
|
162
|
-
)),
|
|
139
|
+
title: ( localize2WithPath(_moduleId, 5, 'Show Contents')),
|
|
163
140
|
menu: {
|
|
164
141
|
id: MenuId.TimelineItemContext,
|
|
165
142
|
group: '3_contents',
|
|
@@ -177,11 +154,7 @@ registerAction2(class extends Action2 {
|
|
|
177
154
|
}
|
|
178
155
|
}
|
|
179
156
|
});
|
|
180
|
-
const RESTORE_CONTENTS_LABEL = ( localize2WithPath(
|
|
181
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
182
|
-
'localHistory.restore',
|
|
183
|
-
'Restore Contents'
|
|
184
|
-
));
|
|
157
|
+
const RESTORE_CONTENTS_LABEL = ( localize2WithPath(_moduleId, 6, 'Restore Contents'));
|
|
185
158
|
registerAction2(class extends Action2 {
|
|
186
159
|
constructor() {
|
|
187
160
|
super({
|
|
@@ -191,7 +164,7 @@ registerAction2(class extends Action2 {
|
|
|
191
164
|
id: MenuId.EditorTitle,
|
|
192
165
|
group: 'navigation',
|
|
193
166
|
order: -10,
|
|
194
|
-
when: ( ResourceContextKey.Scheme.isEqualTo(LocalHistoryFileSystemProvider.SCHEMA))
|
|
167
|
+
when: ( (ResourceContextKey.Scheme.isEqualTo(LocalHistoryFileSystemProvider.SCHEMA)))
|
|
195
168
|
},
|
|
196
169
|
icon: LOCAL_HISTORY_ICON_RESTORE
|
|
197
170
|
});
|
|
@@ -218,11 +191,7 @@ registerAction2(class extends Action2 {
|
|
|
218
191
|
return restore(accessor, item);
|
|
219
192
|
}
|
|
220
193
|
});
|
|
221
|
-
const restoreSaveSource = SaveSourceRegistry.registerSource('localHistoryRestore.source', ( localizeWithPath(
|
|
222
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
223
|
-
'localHistoryRestore.source',
|
|
224
|
-
"File Restored"
|
|
225
|
-
)));
|
|
194
|
+
const restoreSaveSource = SaveSourceRegistry.registerSource('localHistoryRestore.source', ( localizeWithPath(_moduleId, 7, "File Restored")));
|
|
226
195
|
async function restore(accessor, item) {
|
|
227
196
|
const fileService = accessor.get(IFileService);
|
|
228
197
|
const dialogService = accessor.get(IDialogService);
|
|
@@ -234,21 +203,13 @@ async function restore(accessor, item) {
|
|
|
234
203
|
const { confirmed } = await dialogService.confirm({
|
|
235
204
|
type: 'warning',
|
|
236
205
|
message: ( localizeWithPath(
|
|
237
|
-
|
|
238
|
-
|
|
206
|
+
_moduleId,
|
|
207
|
+
8,
|
|
239
208
|
"Do you want to restore the contents of '{0}'?",
|
|
240
209
|
basename(entry.workingCopy.resource)
|
|
241
210
|
)),
|
|
242
|
-
detail: ( localizeWithPath(
|
|
243
|
-
|
|
244
|
-
'confirmRestoreDetail',
|
|
245
|
-
"Restoring will discard any unsaved changes."
|
|
246
|
-
)),
|
|
247
|
-
primaryButton: ( localizeWithPath(
|
|
248
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
249
|
-
{ key: 'restoreButtonLabel', comment: ['&& denotes a mnemonic'] },
|
|
250
|
-
"&&Restore"
|
|
251
|
-
))
|
|
211
|
+
detail: ( localizeWithPath(_moduleId, 9, "Restoring will discard any unsaved changes.")),
|
|
212
|
+
primaryButton: ( localizeWithPath(_moduleId, 10, "&&Restore"))
|
|
252
213
|
});
|
|
253
214
|
if (!confirmed) {
|
|
254
215
|
return;
|
|
@@ -266,8 +227,8 @@ async function restore(accessor, item) {
|
|
|
266
227
|
}
|
|
267
228
|
catch (error) {
|
|
268
229
|
await dialogService.error(( localizeWithPath(
|
|
269
|
-
|
|
270
|
-
|
|
230
|
+
_moduleId,
|
|
231
|
+
11,
|
|
271
232
|
"Unable to restore '{0}'.",
|
|
272
233
|
basename(entry.workingCopy.resource)
|
|
273
234
|
)), toErrorMessage(error));
|
|
@@ -290,11 +251,7 @@ registerAction2(class extends Action2 {
|
|
|
290
251
|
constructor() {
|
|
291
252
|
super({
|
|
292
253
|
id: 'workbench.action.localHistory.restoreViaPicker',
|
|
293
|
-
title: ( localize2WithPath(
|
|
294
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
295
|
-
'localHistory.restoreViaPicker',
|
|
296
|
-
'Find Entry to Restore'
|
|
297
|
-
)),
|
|
254
|
+
title: ( localize2WithPath(_moduleId, 12, 'Find Entry to Restore')),
|
|
298
255
|
f1: true,
|
|
299
256
|
category: LOCAL_HISTORY_CATEGORY
|
|
300
257
|
});
|
|
@@ -309,25 +266,21 @@ registerAction2(class extends Action2 {
|
|
|
309
266
|
const fileService = accessor.get(IFileService);
|
|
310
267
|
const commandService = accessor.get(ICommandService);
|
|
311
268
|
const resourcePicker = quickInputService.createQuickPick();
|
|
312
|
-
let cts = ( new CancellationTokenSource());
|
|
269
|
+
let cts = ( (new CancellationTokenSource()));
|
|
313
270
|
resourcePicker.onDidHide(() => cts.dispose(true));
|
|
314
271
|
resourcePicker.busy = true;
|
|
315
272
|
resourcePicker.show();
|
|
316
273
|
const resources = await workingCopyHistoryService.getAll(cts.token);
|
|
317
274
|
resourcePicker.busy = false;
|
|
318
|
-
resourcePicker.placeholder = ( localizeWithPath(
|
|
319
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
320
|
-
'restoreViaPicker.filePlaceholder',
|
|
321
|
-
"Select the file to show local history for"
|
|
322
|
-
));
|
|
275
|
+
resourcePicker.placeholder = ( localizeWithPath(_moduleId, 13, "Select the file to show local history for"));
|
|
323
276
|
resourcePicker.matchOnLabel = true;
|
|
324
277
|
resourcePicker.matchOnDescription = true;
|
|
325
|
-
resourcePicker.items = ( resources.map(resource => ({
|
|
278
|
+
resourcePicker.items = ( (resources.map(resource => ({
|
|
326
279
|
resource,
|
|
327
280
|
label: basenameOrAuthority(resource),
|
|
328
281
|
description: labelService.getUriLabel(dirname(resource), { relative: true }),
|
|
329
282
|
iconClasses: getIconClasses(modelService, languageService, resource)
|
|
330
|
-
}))).sort((r1, r2) => r1.resource.fsPath < r2.resource.fsPath ? -1 : 1);
|
|
283
|
+
})))).sort((r1, r2) => r1.resource.fsPath < r2.resource.fsPath ? -1 : 1);
|
|
331
284
|
await Event.toPromise(resourcePicker.onDidAccept);
|
|
332
285
|
resourcePicker.dispose();
|
|
333
286
|
const resource = firstOrDefault(resourcePicker.selectedItems)?.resource;
|
|
@@ -335,24 +288,20 @@ registerAction2(class extends Action2 {
|
|
|
335
288
|
return;
|
|
336
289
|
}
|
|
337
290
|
const entryPicker = quickInputService.createQuickPick();
|
|
338
|
-
cts = ( new CancellationTokenSource());
|
|
291
|
+
cts = ( (new CancellationTokenSource()));
|
|
339
292
|
entryPicker.onDidHide(() => cts.dispose(true));
|
|
340
293
|
entryPicker.busy = true;
|
|
341
294
|
entryPicker.show();
|
|
342
295
|
const entries = await workingCopyHistoryService.getEntries(resource, cts.token);
|
|
343
296
|
entryPicker.busy = false;
|
|
344
|
-
entryPicker.placeholder = ( localizeWithPath(
|
|
345
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
346
|
-
'restoreViaPicker.entryPlaceholder',
|
|
347
|
-
"Select the local history entry to open"
|
|
348
|
-
));
|
|
297
|
+
entryPicker.placeholder = ( localizeWithPath(_moduleId, 14, "Select the local history entry to open"));
|
|
349
298
|
entryPicker.matchOnLabel = true;
|
|
350
299
|
entryPicker.matchOnDescription = true;
|
|
351
|
-
entryPicker.items = ( Array.from(entries).reverse().map(entry => ({
|
|
300
|
+
entryPicker.items = ( (Array.from(entries).reverse().map(entry => ({
|
|
352
301
|
entry,
|
|
353
302
|
label: `$(circle-outline) ${SaveSourceRegistry.getSourceLabel(entry.source)}`,
|
|
354
303
|
description: toLocalHistoryEntryDateLabel(entry.timestamp)
|
|
355
|
-
})));
|
|
304
|
+
}))));
|
|
356
305
|
await Event.toPromise(entryPicker.onDidAccept);
|
|
357
306
|
entryPicker.dispose();
|
|
358
307
|
const selectedItem = firstOrDefault(entryPicker.selectedItems);
|
|
@@ -366,20 +315,12 @@ registerAction2(class extends Action2 {
|
|
|
366
315
|
return openEntry(selectedItem.entry, editorService);
|
|
367
316
|
}
|
|
368
317
|
});
|
|
369
|
-
MenuRegistry.appendMenuItem(MenuId.TimelineTitle, { command: { id: 'workbench.action.localHistory.restoreViaPicker', title: ( localize2WithPath(
|
|
370
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
371
|
-
'localHistory.restoreViaPickerMenu',
|
|
372
|
-
'Local History: Find Entry to Restore...'
|
|
373
|
-
)) }, group: 'submenu', order: 1 });
|
|
318
|
+
MenuRegistry.appendMenuItem(MenuId.TimelineTitle, { command: { id: 'workbench.action.localHistory.restoreViaPicker', title: ( localize2WithPath(_moduleId, 15, 'Local History: Find Entry to Restore...')) }, group: 'submenu', order: 1 });
|
|
374
319
|
registerAction2(class extends Action2 {
|
|
375
320
|
constructor() {
|
|
376
321
|
super({
|
|
377
322
|
id: 'workbench.action.localHistory.rename',
|
|
378
|
-
title: ( localize2WithPath(
|
|
379
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
380
|
-
'localHistory.rename',
|
|
381
|
-
'Rename'
|
|
382
|
-
)),
|
|
323
|
+
title: ( localize2WithPath(_moduleId, 16, 'Rename')),
|
|
383
324
|
menu: {
|
|
384
325
|
id: MenuId.TimelineItemContext,
|
|
385
326
|
group: '5_edit',
|
|
@@ -394,17 +335,9 @@ registerAction2(class extends Action2 {
|
|
|
394
335
|
const { entry } = await findLocalHistoryEntry(workingCopyHistoryService, item);
|
|
395
336
|
if (entry) {
|
|
396
337
|
const inputBox = quickInputService.createInputBox();
|
|
397
|
-
inputBox.title = ( localizeWithPath(
|
|
398
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
399
|
-
'renameLocalHistoryEntryTitle',
|
|
400
|
-
"Rename Local History Entry"
|
|
401
|
-
));
|
|
338
|
+
inputBox.title = ( localizeWithPath(_moduleId, 17, "Rename Local History Entry"));
|
|
402
339
|
inputBox.ignoreFocusOut = true;
|
|
403
|
-
inputBox.placeholder = ( localizeWithPath(
|
|
404
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
405
|
-
'renameLocalHistoryPlaceholder',
|
|
406
|
-
"Enter the new name of the local history entry"
|
|
407
|
-
));
|
|
340
|
+
inputBox.placeholder = ( localizeWithPath(_moduleId, 18, "Enter the new name of the local history entry"));
|
|
408
341
|
inputBox.value = SaveSourceRegistry.getSourceLabel(entry.source);
|
|
409
342
|
inputBox.show();
|
|
410
343
|
inputBox.onDidAccept(() => {
|
|
@@ -420,11 +353,7 @@ registerAction2(class extends Action2 {
|
|
|
420
353
|
constructor() {
|
|
421
354
|
super({
|
|
422
355
|
id: 'workbench.action.localHistory.delete',
|
|
423
|
-
title: ( localize2WithPath(
|
|
424
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
425
|
-
'localHistory.delete',
|
|
426
|
-
'Delete'
|
|
427
|
-
)),
|
|
356
|
+
title: ( localize2WithPath(_moduleId, 19, 'Delete')),
|
|
428
357
|
menu: {
|
|
429
358
|
id: MenuId.TimelineItemContext,
|
|
430
359
|
group: '5_edit',
|
|
@@ -442,22 +371,14 @@ registerAction2(class extends Action2 {
|
|
|
442
371
|
const { confirmed } = await dialogService.confirm({
|
|
443
372
|
type: 'warning',
|
|
444
373
|
message: ( localizeWithPath(
|
|
445
|
-
|
|
446
|
-
|
|
374
|
+
_moduleId,
|
|
375
|
+
20,
|
|
447
376
|
"Do you want to delete the local history entry of '{0}' from {1}?",
|
|
448
377
|
entry.workingCopy.name,
|
|
449
378
|
toLocalHistoryEntryDateLabel(entry.timestamp)
|
|
450
379
|
)),
|
|
451
|
-
detail: ( localizeWithPath(
|
|
452
|
-
|
|
453
|
-
'confirmDeleteDetail',
|
|
454
|
-
"This action is irreversible!"
|
|
455
|
-
)),
|
|
456
|
-
primaryButton: ( localizeWithPath(
|
|
457
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
458
|
-
{ key: 'deleteButtonLabel', comment: ['&& denotes a mnemonic'] },
|
|
459
|
-
"&&Delete"
|
|
460
|
-
)),
|
|
380
|
+
detail: ( localizeWithPath(_moduleId, 21, "This action is irreversible!")),
|
|
381
|
+
primaryButton: ( localizeWithPath(_moduleId, 22, "&&Delete")),
|
|
461
382
|
});
|
|
462
383
|
if (!confirmed) {
|
|
463
384
|
return;
|
|
@@ -471,11 +392,7 @@ registerAction2(class extends Action2 {
|
|
|
471
392
|
constructor() {
|
|
472
393
|
super({
|
|
473
394
|
id: 'workbench.action.localHistory.deleteAll',
|
|
474
|
-
title: ( localize2WithPath(
|
|
475
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
476
|
-
'localHistory.deleteAll',
|
|
477
|
-
'Delete All'
|
|
478
|
-
)),
|
|
395
|
+
title: ( localize2WithPath(_moduleId, 23, 'Delete All')),
|
|
479
396
|
f1: true,
|
|
480
397
|
category: LOCAL_HISTORY_CATEGORY
|
|
481
398
|
});
|
|
@@ -486,20 +403,12 @@ registerAction2(class extends Action2 {
|
|
|
486
403
|
const { confirmed } = await dialogService.confirm({
|
|
487
404
|
type: 'warning',
|
|
488
405
|
message: ( localizeWithPath(
|
|
489
|
-
|
|
490
|
-
|
|
406
|
+
_moduleId,
|
|
407
|
+
24,
|
|
491
408
|
"Do you want to delete all entries of all files in local history?"
|
|
492
409
|
)),
|
|
493
|
-
detail: ( localizeWithPath(
|
|
494
|
-
|
|
495
|
-
'confirmDeleteAllDetail',
|
|
496
|
-
"This action is irreversible!"
|
|
497
|
-
)),
|
|
498
|
-
primaryButton: ( localizeWithPath(
|
|
499
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
500
|
-
{ key: 'deleteAllButtonLabel', comment: ['&& denotes a mnemonic'] },
|
|
501
|
-
"&&Delete All"
|
|
502
|
-
)),
|
|
410
|
+
detail: ( localizeWithPath(_moduleId, 25, "This action is irreversible!")),
|
|
411
|
+
primaryButton: ( localizeWithPath(_moduleId, 26, "&&Delete All")),
|
|
503
412
|
});
|
|
504
413
|
if (!confirmed) {
|
|
505
414
|
return;
|
|
@@ -511,11 +420,7 @@ registerAction2(class extends Action2 {
|
|
|
511
420
|
constructor() {
|
|
512
421
|
super({
|
|
513
422
|
id: 'workbench.action.localHistory.create',
|
|
514
|
-
title: ( localize2WithPath(
|
|
515
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
516
|
-
'localHistory.create',
|
|
517
|
-
'Create Entry'
|
|
518
|
-
)),
|
|
423
|
+
title: ( localize2WithPath(_moduleId, 27, 'Create Entry')),
|
|
519
424
|
f1: true,
|
|
520
425
|
category: LOCAL_HISTORY_CATEGORY,
|
|
521
426
|
precondition: ActiveEditorContext
|
|
@@ -532,15 +437,11 @@ registerAction2(class extends Action2 {
|
|
|
532
437
|
return;
|
|
533
438
|
}
|
|
534
439
|
const inputBox = quickInputService.createInputBox();
|
|
535
|
-
inputBox.title = ( localizeWithPath(
|
|
536
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryCommands',
|
|
537
|
-
'createLocalHistoryEntryTitle',
|
|
538
|
-
"Create Local History Entry"
|
|
539
|
-
));
|
|
440
|
+
inputBox.title = ( localizeWithPath(_moduleId, 28, "Create Local History Entry"));
|
|
540
441
|
inputBox.ignoreFocusOut = true;
|
|
541
442
|
inputBox.placeholder = ( localizeWithPath(
|
|
542
|
-
|
|
543
|
-
|
|
443
|
+
_moduleId,
|
|
444
|
+
29,
|
|
544
445
|
"Enter the new name of the local history entry for '{0}'",
|
|
545
446
|
labelService.getUriBasenameLabel(resource)
|
|
546
447
|
));
|
|
@@ -559,8 +460,8 @@ async function openEntry(entry, editorService) {
|
|
|
559
460
|
await editorService.openEditor({
|
|
560
461
|
resource,
|
|
561
462
|
label: ( localizeWithPath(
|
|
562
|
-
|
|
563
|
-
|
|
463
|
+
_moduleId,
|
|
464
|
+
30,
|
|
564
465
|
"{0} ({1} • {2})",
|
|
565
466
|
entry.workingCopy.name,
|
|
566
467
|
SaveSourceRegistry.getSourceLabel(entry.source),
|
|
@@ -581,8 +482,8 @@ function toDiffEditorArguments(arg1, arg2) {
|
|
|
581
482
|
const resource = arg2;
|
|
582
483
|
modifiedResource = resource;
|
|
583
484
|
label = ( localizeWithPath(
|
|
584
|
-
|
|
585
|
-
|
|
485
|
+
_moduleId,
|
|
486
|
+
31,
|
|
586
487
|
"{0} ({1} • {2}) ↔ {3}",
|
|
587
488
|
arg1.workingCopy.name,
|
|
588
489
|
SaveSourceRegistry.getSourceLabel(arg1.source),
|
|
@@ -594,8 +495,8 @@ function toDiffEditorArguments(arg1, arg2) {
|
|
|
594
495
|
const modified = arg2;
|
|
595
496
|
modifiedResource = LocalHistoryFileSystemProvider.toLocalHistoryFileSystem({ location: modified.location, associatedResource: modified.workingCopy.resource });
|
|
596
497
|
label = ( localizeWithPath(
|
|
597
|
-
|
|
598
|
-
|
|
498
|
+
_moduleId,
|
|
499
|
+
32,
|
|
599
500
|
"{0} ({1} • {2}) ↔ {3} ({4} • {5})",
|
|
600
501
|
arg1.workingCopy.name,
|
|
601
502
|
SaveSourceRegistry.getSourceLabel(arg1.source),
|
package/vscode/src/vs/workbench/contrib/localHistory/browser/localHistoryFileSystemProvider.js
CHANGED
|
@@ -76,7 +76,7 @@ class LocalHistoryFileSystemProvider {
|
|
|
76
76
|
if (hasReadWriteCapability(provider)) {
|
|
77
77
|
return provider.readFile(location);
|
|
78
78
|
}
|
|
79
|
-
throw new Error('Unsupported');
|
|
79
|
+
throw ( new Error('Unsupported'));
|
|
80
80
|
}
|
|
81
81
|
async writeFile(resource, content, opts) { }
|
|
82
82
|
async mkdir(resource) { }
|
|
@@ -20,6 +20,7 @@ import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/co
|
|
|
20
20
|
import { getVirtualWorkspaceAuthority } from 'vscode/vscode/vs/platform/workspace/common/virtualWorkspace';
|
|
21
21
|
|
|
22
22
|
var LocalHistoryTimeline_1;
|
|
23
|
+
const _moduleId = "vs/workbench/contrib/localHistory/browser/localHistoryTimeline";
|
|
23
24
|
let LocalHistoryTimeline = class LocalHistoryTimeline extends Disposable {
|
|
24
25
|
static { LocalHistoryTimeline_1 = this; }
|
|
25
26
|
static { this.ID = 'workbench.contrib.localHistoryTimeline'; }
|
|
@@ -34,21 +35,17 @@ let LocalHistoryTimeline = class LocalHistoryTimeline extends Disposable {
|
|
|
34
35
|
this.configurationService = configurationService;
|
|
35
36
|
this.contextService = contextService;
|
|
36
37
|
this.id = 'timeline.localHistory';
|
|
37
|
-
this.label = ( localizeWithPath(
|
|
38
|
-
'vs/workbench/contrib/localHistory/browser/localHistoryTimeline',
|
|
39
|
-
'localHistory',
|
|
40
|
-
"Local History"
|
|
41
|
-
));
|
|
38
|
+
this.label = ( localizeWithPath(_moduleId, 0, "Local History"));
|
|
42
39
|
this.scheme = '*';
|
|
43
|
-
this._onDidChange = this._register(( new Emitter()));
|
|
40
|
+
this._onDidChange = this._register(( (new Emitter())));
|
|
44
41
|
this.onDidChange = this._onDidChange.event;
|
|
45
|
-
this.timelineProviderDisposable = this._register(( new MutableDisposable()));
|
|
42
|
+
this.timelineProviderDisposable = this._register(( (new MutableDisposable())));
|
|
46
43
|
this.registerComponents();
|
|
47
44
|
this.registerListeners();
|
|
48
45
|
}
|
|
49
46
|
registerComponents() {
|
|
50
47
|
this.updateTimelineRegistration();
|
|
51
|
-
this._register(this.fileService.registerProvider(LocalHistoryFileSystemProvider.SCHEMA, ( new LocalHistoryFileSystemProvider(this.fileService))));
|
|
48
|
+
this._register(this.fileService.registerProvider(LocalHistoryFileSystemProvider.SCHEMA, ( (new LocalHistoryFileSystemProvider(this.fileService)))));
|
|
52
49
|
}
|
|
53
50
|
updateTimelineRegistration() {
|
|
54
51
|
if (this.configurationService.getValue(LocalHistoryTimeline_1.LOCAL_HISTORY_ENABLED_SETTINGS_KEY)) {
|
|
@@ -88,11 +85,11 @@ let LocalHistoryTimeline = class LocalHistoryTimeline extends Disposable {
|
|
|
88
85
|
resource = uri;
|
|
89
86
|
}
|
|
90
87
|
else if (this.fileService.hasProvider(uri)) {
|
|
91
|
-
resource = ( URI.from({
|
|
88
|
+
resource = ( (URI.from({
|
|
92
89
|
scheme: this.pathService.defaultUriScheme,
|
|
93
90
|
authority: this.environmentService.remoteAuthority ?? getVirtualWorkspaceAuthority(this.contextService.getWorkspace()),
|
|
94
91
|
path: uri.path
|
|
95
|
-
}));
|
|
92
|
+
})));
|
|
96
93
|
}
|
|
97
94
|
if (resource) {
|
|
98
95
|
const entries = await this.workingCopyHistoryService.getEntries(resource, token);
|
|
@@ -109,10 +106,10 @@ let LocalHistoryTimeline = class LocalHistoryTimeline extends Disposable {
|
|
|
109
106
|
return {
|
|
110
107
|
handle: entry.id,
|
|
111
108
|
label: SaveSourceRegistry.getSourceLabel(entry.source),
|
|
112
|
-
tooltip: ( new MarkdownString(
|
|
109
|
+
tooltip: ( (new MarkdownString(
|
|
113
110
|
`$(history) ${getLocalHistoryDateFormatter().format(entry.timestamp)}\n\n${SaveSourceRegistry.getSourceLabel(entry.source)}`,
|
|
114
111
|
{ supportThemeIcons: true }
|
|
115
|
-
)),
|
|
112
|
+
))),
|
|
116
113
|
source: this.id,
|
|
117
114
|
timestamp: entry.timestamp,
|
|
118
115
|
themeIcon: LOCAL_HISTORY_ICON_ENTRY,
|
|
@@ -125,14 +122,14 @@ let LocalHistoryTimeline = class LocalHistoryTimeline extends Disposable {
|
|
|
125
122
|
};
|
|
126
123
|
}
|
|
127
124
|
};
|
|
128
|
-
LocalHistoryTimeline = LocalHistoryTimeline_1 = ( __decorate([
|
|
129
|
-
( __param(0, ITimelineService)),
|
|
130
|
-
( __param(1, IWorkingCopyHistoryService)),
|
|
131
|
-
( __param(2, IPathService)),
|
|
132
|
-
( __param(3, IFileService)),
|
|
133
|
-
( __param(4, IWorkbenchEnvironmentService)),
|
|
134
|
-
( __param(5, IConfigurationService)),
|
|
135
|
-
( __param(6, IWorkspaceContextService))
|
|
136
|
-
], LocalHistoryTimeline));
|
|
125
|
+
LocalHistoryTimeline = LocalHistoryTimeline_1 = ( (__decorate([
|
|
126
|
+
( (__param(0, ITimelineService))),
|
|
127
|
+
( (__param(1, IWorkingCopyHistoryService))),
|
|
128
|
+
( (__param(2, IPathService))),
|
|
129
|
+
( (__param(3, IFileService))),
|
|
130
|
+
( (__param(4, IWorkbenchEnvironmentService))),
|
|
131
|
+
( (__param(5, IConfigurationService))),
|
|
132
|
+
( (__param(6, IWorkspaceContextService)))
|
|
133
|
+
], LocalHistoryTimeline)));
|
|
137
134
|
|
|
138
135
|
export { LocalHistoryTimeline };
|
|
@@ -16,22 +16,15 @@ import { ResourceContextKey } from 'vscode/vscode/vs/workbench/common/contextkey
|
|
|
16
16
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
17
17
|
import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
'View icon of the timeline view.'
|
|
23
|
-
)));
|
|
24
|
-
const timelineOpenIcon = registerIcon('timeline-open', Codicon.history, ( localizeWithPath(
|
|
25
|
-
'vs/workbench/contrib/timeline/browser/timeline.contribution',
|
|
26
|
-
'timelineOpenIcon',
|
|
27
|
-
'Icon for the open timeline action.'
|
|
28
|
-
)));
|
|
19
|
+
const _moduleId = "vs/workbench/contrib/timeline/browser/timeline.contribution";
|
|
20
|
+
const timelineViewIcon = registerIcon('timeline-view-icon', Codicon.history, ( localizeWithPath(_moduleId, 0, 'View icon of the timeline view.')));
|
|
21
|
+
const timelineOpenIcon = registerIcon('timeline-open', Codicon.history, ( localizeWithPath(_moduleId, 1, 'Icon for the open timeline action.')));
|
|
29
22
|
class TimelinePaneDescriptor {
|
|
30
23
|
constructor() {
|
|
31
24
|
this.id = TimelinePaneId;
|
|
32
25
|
this.name = TimelinePane.TITLE;
|
|
33
26
|
this.containerIcon = timelineViewIcon;
|
|
34
|
-
this.ctorDescriptor = ( new SyncDescriptor(TimelinePane));
|
|
27
|
+
this.ctorDescriptor = ( (new SyncDescriptor(TimelinePane)));
|
|
35
28
|
this.order = 2;
|
|
36
29
|
this.weight = 30;
|
|
37
30
|
this.collapsed = true;
|
|
@@ -42,23 +35,19 @@ class TimelinePaneDescriptor {
|
|
|
42
35
|
this.focusCommand = { id: 'timeline.focus' };
|
|
43
36
|
}
|
|
44
37
|
}
|
|
45
|
-
const configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
38
|
+
const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
|
|
46
39
|
configurationRegistry.registerConfiguration({
|
|
47
40
|
id: 'timeline',
|
|
48
41
|
order: 1001,
|
|
49
|
-
title: ( localizeWithPath(
|
|
50
|
-
'vs/workbench/contrib/timeline/browser/timeline.contribution',
|
|
51
|
-
'timelineConfigurationTitle',
|
|
52
|
-
"Timeline"
|
|
53
|
-
)),
|
|
42
|
+
title: ( localizeWithPath(_moduleId, 2, "Timeline")),
|
|
54
43
|
type: 'object',
|
|
55
44
|
properties: {
|
|
56
45
|
'timeline.pageSize': {
|
|
57
46
|
type: ['number', 'null'],
|
|
58
47
|
default: null,
|
|
59
48
|
markdownDescription: ( localizeWithPath(
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
_moduleId,
|
|
50
|
+
3,
|
|
62
51
|
"The number of items to show in the Timeline view by default and when loading more items. Setting to `null` (the default) will automatically choose a page size based on the visible area of the Timeline view."
|
|
63
52
|
)),
|
|
64
53
|
},
|
|
@@ -66,22 +55,18 @@ configurationRegistry.registerConfiguration({
|
|
|
66
55
|
type: 'boolean',
|
|
67
56
|
default: false,
|
|
68
57
|
description: ( localizeWithPath(
|
|
69
|
-
|
|
70
|
-
|
|
58
|
+
_moduleId,
|
|
59
|
+
4,
|
|
71
60
|
"Experimental. Controls whether the Timeline view will load the next page of items when you scroll to the end of the list."
|
|
72
61
|
)),
|
|
73
62
|
},
|
|
74
63
|
}
|
|
75
64
|
});
|
|
76
|
-
( Registry.as(Extensions$1.ViewsRegistry)).registerViews([( new TimelinePaneDescriptor())], VIEW_CONTAINER);
|
|
65
|
+
( (Registry.as(Extensions$1.ViewsRegistry))).registerViews([( (new TimelinePaneDescriptor()))], VIEW_CONTAINER);
|
|
77
66
|
var OpenTimelineAction;
|
|
78
|
-
( (function(OpenTimelineAction) {
|
|
67
|
+
( ((function(OpenTimelineAction) {
|
|
79
68
|
OpenTimelineAction.ID = 'files.openTimeline';
|
|
80
|
-
OpenTimelineAction.LABEL = ( localizeWithPath(
|
|
81
|
-
'vs/workbench/contrib/timeline/browser/timeline.contribution',
|
|
82
|
-
'files.openTimeline',
|
|
83
|
-
"Open Timeline"
|
|
84
|
-
));
|
|
69
|
+
OpenTimelineAction.LABEL = ( localizeWithPath(_moduleId, 5, "Open Timeline"));
|
|
85
70
|
function handler() {
|
|
86
71
|
return (accessor, arg) => {
|
|
87
72
|
const service = accessor.get(ITimelineService);
|
|
@@ -89,7 +74,7 @@ var OpenTimelineAction;
|
|
|
89
74
|
};
|
|
90
75
|
}
|
|
91
76
|
OpenTimelineAction.handler = handler;
|
|
92
|
-
})(OpenTimelineAction || (OpenTimelineAction = {})));
|
|
77
|
+
})(OpenTimelineAction || (OpenTimelineAction = {}))));
|
|
93
78
|
CommandsRegistry.registerCommand(OpenTimelineAction.ID, OpenTimelineAction.handler());
|
|
94
79
|
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, ({
|
|
95
80
|
group: '4_timeline',
|
|
@@ -99,20 +84,16 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, ({
|
|
|
99
84
|
title: OpenTimelineAction.LABEL,
|
|
100
85
|
icon: timelineOpenIcon
|
|
101
86
|
},
|
|
102
|
-
when: ( ContextKeyExpr.and(
|
|
87
|
+
when: ( (ContextKeyExpr.and(
|
|
88
|
+
(ExplorerFolderContext.toNegated()),
|
|
89
|
+
ResourceContextKey.HasResource,
|
|
90
|
+
TimelineHasProviderContext
|
|
91
|
+
)))
|
|
103
92
|
}));
|
|
104
|
-
const timelineFilter = registerIcon('timeline-filter', Codicon.filter, ( localizeWithPath(
|
|
105
|
-
'vs/workbench/contrib/timeline/browser/timeline.contribution',
|
|
106
|
-
'timelineFilter',
|
|
107
|
-
'Icon for the filter timeline action.'
|
|
108
|
-
)));
|
|
93
|
+
const timelineFilter = registerIcon('timeline-filter', Codicon.filter, ( localizeWithPath(_moduleId, 6, 'Icon for the filter timeline action.')));
|
|
109
94
|
MenuRegistry.appendMenuItem(MenuId.TimelineTitle, {
|
|
110
95
|
submenu: MenuId.TimelineFilterSubMenu,
|
|
111
|
-
title: ( localizeWithPath(
|
|
112
|
-
'vs/workbench/contrib/timeline/browser/timeline.contribution',
|
|
113
|
-
'filterTimeline',
|
|
114
|
-
"Filter Timeline"
|
|
115
|
-
)),
|
|
96
|
+
title: ( localizeWithPath(_moduleId, 7, "Filter Timeline")),
|
|
116
97
|
group: 'navigation',
|
|
117
98
|
order: 100,
|
|
118
99
|
icon: timelineFilter
|
|
@@ -49,7 +49,9 @@ import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/commo
|
|
|
49
49
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
50
50
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
51
51
|
import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
52
|
+
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
52
53
|
|
|
54
|
+
const _moduleId = "vs/workbench/contrib/timeline/browser/timelinePane";
|
|
53
55
|
const ItemHeight = 22;
|
|
54
56
|
function isLoadMoreCommand(item) {
|
|
55
57
|
return item instanceof LoadMoreCommand;
|
|
@@ -94,8 +96,8 @@ class TimelineAggregate {
|
|
|
94
96
|
let updated = false;
|
|
95
97
|
if (timeline.items.length !== 0 && this.items.length !== 0) {
|
|
96
98
|
updated = true;
|
|
97
|
-
const ids = ( new Set());
|
|
98
|
-
const timestamps = ( new Set());
|
|
99
|
+
const ids = ( (new Set()));
|
|
100
|
+
const timestamps = ( (new Set()));
|
|
99
101
|
for (const item of timeline.items) {
|
|
100
102
|
if (item.id === undefined) {
|
|
101
103
|
timestamps.add(item.timestamp);
|
|
@@ -108,7 +110,7 @@ class TimelineAggregate {
|
|
|
108
110
|
let item;
|
|
109
111
|
while (i--) {
|
|
110
112
|
item = this.items[i];
|
|
111
|
-
if ((item.id !== undefined && ( ids.has(item.id))) || ( timestamps.has(item.timestamp))) {
|
|
113
|
+
if ((item.id !== undefined && ( (ids.has(item.id)))) || ( (timestamps.has(item.timestamp)))) {
|
|
112
114
|
this.items.splice(i, 1);
|
|
113
115
|
}
|
|
114
116
|
}
|
|
@@ -172,30 +174,18 @@ class LoadMoreCommand {
|
|
|
172
174
|
return this.label;
|
|
173
175
|
}
|
|
174
176
|
get label() {
|
|
175
|
-
return this.loading ? ( localizeWithPath(
|
|
176
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
177
|
-
'timeline.loadingMore',
|
|
178
|
-
"Loading..."
|
|
179
|
-
)) : ( localizeWithPath(
|
|
180
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
181
|
-
'timeline.loadMore',
|
|
182
|
-
"Load more"
|
|
183
|
-
));
|
|
177
|
+
return this.loading ? ( localizeWithPath(_moduleId, 0, "Loading...")) : ( localizeWithPath(_moduleId, 1, "Load more"));
|
|
184
178
|
}
|
|
185
179
|
get themeIcon() {
|
|
186
180
|
return undefined;
|
|
187
181
|
}
|
|
188
182
|
}
|
|
189
|
-
const TimelineFollowActiveEditorContext = ( new RawContextKey('timelineFollowActiveEditor', true, true));
|
|
190
|
-
const TimelineExcludeSources = ( new RawContextKey('timelineExcludeSources', '[]', true));
|
|
183
|
+
const TimelineFollowActiveEditorContext = ( (new RawContextKey('timelineFollowActiveEditor', true, true)));
|
|
184
|
+
const TimelineExcludeSources = ( (new RawContextKey('timelineExcludeSources', '[]', true)));
|
|
191
185
|
let TimelinePane = class TimelinePane extends ViewPane {
|
|
192
|
-
static { this.TITLE = ( localize2WithPath(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
"Timeline"
|
|
196
|
-
)); }
|
|
197
|
-
constructor(options, keybindingService, contextMenuService, contextKeyService, configurationService, storageService, viewDescriptorService, instantiationService, editorService, commandService, progressService, timelineService, openerService, themeService, telemetryService, labelService, uriIdentityService, extensionService) {
|
|
198
|
-
super({ ...options, titleMenuId: MenuId.TimelineTitle }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
|
186
|
+
static { this.TITLE = ( localize2WithPath(_moduleId, 2, "Timeline")); }
|
|
187
|
+
constructor(options, keybindingService, contextMenuService, contextKeyService, configurationService, storageService, viewDescriptorService, instantiationService, editorService, commandService, progressService, timelineService, openerService, themeService, telemetryService, hoverService, labelService, uriIdentityService, extensionService) {
|
|
188
|
+
super({ ...options, titleMenuId: MenuId.TimelineTitle }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService);
|
|
199
189
|
this.storageService = storageService;
|
|
200
190
|
this.editorService = editorService;
|
|
201
191
|
this.commandService = commandService;
|
|
@@ -204,8 +194,8 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
204
194
|
this.labelService = labelService;
|
|
205
195
|
this.uriIdentityService = uriIdentityService;
|
|
206
196
|
this.extensionService = extensionService;
|
|
207
|
-
this.pendingRequests = ( new Map());
|
|
208
|
-
this.timelinesBySource = ( new Map());
|
|
197
|
+
this.pendingRequests = ( (new Map()));
|
|
198
|
+
this.timelinesBySource = ( (new Map()));
|
|
209
199
|
this._followActiveEditor = true;
|
|
210
200
|
this._isEmpty = true;
|
|
211
201
|
this._maxItemCount = 0;
|
|
@@ -216,8 +206,8 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
216
206
|
this.timelineExcludeSourcesContext = TimelineExcludeSources.bindTo(this.contextKeyService);
|
|
217
207
|
const excludedSourcesString = storageService.get('timeline.excludeSources', 0 , '[]');
|
|
218
208
|
this.timelineExcludeSourcesContext.set(excludedSourcesString);
|
|
219
|
-
this.excludedSources = ( new Set(JSON.parse(excludedSourcesString)));
|
|
220
|
-
this._register(storageService.onDidChangeValue(0 , 'timeline.excludeSources', this._register(( new DisposableStore())))(this.onStorageServiceChanged, this));
|
|
209
|
+
this.excludedSources = ( (new Set(JSON.parse(excludedSourcesString))));
|
|
210
|
+
this._register(storageService.onDidChangeValue(0 , 'timeline.excludeSources', this._register(( (new DisposableStore()))))(this.onStorageServiceChanged, this));
|
|
221
211
|
this._register(configurationService.onDidChangeConfiguration(this.onConfigurationChanged, this));
|
|
222
212
|
this._register(timelineService.onDidChangeProviders(this.onProvidersChanged, this));
|
|
223
213
|
this._register(timelineService.onDidChangeTimeline(this.onTimelineChanged, this));
|
|
@@ -268,11 +258,11 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
268
258
|
onStorageServiceChanged() {
|
|
269
259
|
const excludedSourcesString = this.storageService.get('timeline.excludeSources', 0 , '[]');
|
|
270
260
|
this.timelineExcludeSourcesContext.set(excludedSourcesString);
|
|
271
|
-
this.excludedSources = ( new Set(JSON.parse(excludedSourcesString)));
|
|
261
|
+
this.excludedSources = ( (new Set(JSON.parse(excludedSourcesString))));
|
|
272
262
|
const missing = this.timelineService.getSources()
|
|
273
|
-
.filter(({ id }) => !( this.excludedSources.has(id)) && !( this.timelinesBySource.has(id)));
|
|
263
|
+
.filter(({ id }) => !( (this.excludedSources.has(id))) && !( (this.timelinesBySource.has(id))));
|
|
274
264
|
if (missing.length !== 0) {
|
|
275
|
-
this.loadTimeline(true, ( missing.map(({ id }) => id)));
|
|
265
|
+
this.loadTimeline(true, ( (missing.map(({ id }) => id))));
|
|
276
266
|
}
|
|
277
267
|
else {
|
|
278
268
|
this.refresh();
|
|
@@ -291,7 +281,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
291
281
|
if ((this.uriIdentityService.extUri.isEqual(uri, this.uri) && uri !== undefined) ||
|
|
292
282
|
(uri?.fsPath === this.uri?.fsPath && (uri?.scheme === Schemas.file || uri?.scheme === 'git') && (this.uri?.scheme === Schemas.file || this.uri?.scheme === 'git'))) {
|
|
293
283
|
for (const source of this.timelineService.getSources()) {
|
|
294
|
-
if (( this.excludedSources.has(source.id))) {
|
|
284
|
+
if (( (this.excludedSources.has(source.id)))) {
|
|
295
285
|
continue;
|
|
296
286
|
}
|
|
297
287
|
const timeline = this.timelinesBySource.get(source.id);
|
|
@@ -381,7 +371,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
381
371
|
this._maxItemCount = this.pageSize;
|
|
382
372
|
this.timelinesBySource.clear();
|
|
383
373
|
if (cancelPending) {
|
|
384
|
-
for (const { tokenSource } of ( this.pendingRequests.values())) {
|
|
374
|
+
for (const { tokenSource } of ( (this.pendingRequests.values()))) {
|
|
385
375
|
tokenSource.dispose(true);
|
|
386
376
|
}
|
|
387
377
|
this.pendingRequests.clear();
|
|
@@ -415,7 +405,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
415
405
|
return;
|
|
416
406
|
}
|
|
417
407
|
let hasPendingRequests = false;
|
|
418
|
-
for (const source of sources ?? ( this.timelineService.getSources().map(s => s.id))) {
|
|
408
|
+
for (const source of sources ?? ( (this.timelineService.getSources().map(s => s.id)))) {
|
|
419
409
|
const requested = this.loadTimelineForSource(source, this.uri, reset);
|
|
420
410
|
if (requested) {
|
|
421
411
|
hasPendingRequests = true;
|
|
@@ -429,7 +419,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
429
419
|
}
|
|
430
420
|
}
|
|
431
421
|
loadTimelineForSource(source, uri, reset, options) {
|
|
432
|
-
if (( this.excludedSources.has(source))) {
|
|
422
|
+
if (( (this.excludedSources.has(source)))) {
|
|
433
423
|
return false;
|
|
434
424
|
}
|
|
435
425
|
const timeline = this.timelinesBySource.get(source);
|
|
@@ -457,7 +447,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
457
447
|
request?.tokenSource.dispose(true);
|
|
458
448
|
options.cacheResults = true;
|
|
459
449
|
options.resetCache = reset;
|
|
460
|
-
request = this.timelineService.getTimeline(source, uri, options, ( new CancellationTokenSource()));
|
|
450
|
+
request = this.timelineService.getTimeline(source, uri, options, ( (new CancellationTokenSource())));
|
|
461
451
|
if (request === undefined) {
|
|
462
452
|
return false;
|
|
463
453
|
}
|
|
@@ -497,7 +487,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
497
487
|
let updated = false;
|
|
498
488
|
const timeline = this.timelinesBySource.get(source);
|
|
499
489
|
if (timeline === undefined) {
|
|
500
|
-
this.timelinesBySource.set(source, ( new TimelineAggregate(response)));
|
|
490
|
+
this.timelinesBySource.set(source, ( (new TimelineAggregate(response))));
|
|
501
491
|
updated = true;
|
|
502
492
|
}
|
|
503
493
|
else {
|
|
@@ -532,7 +522,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
532
522
|
if (this.timelinesBySource.size === 1) {
|
|
533
523
|
const [source, timeline] = Iterable.first(this.timelinesBySource);
|
|
534
524
|
timeline.lastRenderedIndex = -1;
|
|
535
|
-
if (( this.excludedSources.has(source))) {
|
|
525
|
+
if (( (this.excludedSources.has(source)))) {
|
|
536
526
|
this._visibleItemCount = 0;
|
|
537
527
|
return;
|
|
538
528
|
}
|
|
@@ -560,7 +550,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
560
550
|
let mostRecentEnd = 0;
|
|
561
551
|
for (const [source, timeline] of this.timelinesBySource) {
|
|
562
552
|
timeline.lastRenderedIndex = -1;
|
|
563
|
-
if (( this.excludedSources.has(source)) || timeline.stale) {
|
|
553
|
+
if (( (this.excludedSources.has(source))) || timeline.stale) {
|
|
564
554
|
continue;
|
|
565
555
|
}
|
|
566
556
|
if (timeline.items.length !== 0) {
|
|
@@ -605,12 +595,12 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
605
595
|
if (count > 0) {
|
|
606
596
|
if (more) {
|
|
607
597
|
yield {
|
|
608
|
-
element: ( new LoadMoreCommand(this.pendingRequests.size !== 0))
|
|
598
|
+
element: ( (new LoadMoreCommand(this.pendingRequests.size !== 0)))
|
|
609
599
|
};
|
|
610
600
|
}
|
|
611
601
|
else if (this.pendingRequests.size !== 0) {
|
|
612
602
|
yield {
|
|
613
|
-
element: ( new LoadMoreCommand(true))
|
|
603
|
+
element: ( (new LoadMoreCommand(true)))
|
|
614
604
|
};
|
|
615
605
|
}
|
|
616
606
|
}
|
|
@@ -623,11 +613,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
623
613
|
this._isEmpty = !this.hasVisibleItems;
|
|
624
614
|
if (this.uri === undefined) {
|
|
625
615
|
this.updateFilename(undefined);
|
|
626
|
-
this.message = ( localizeWithPath(
|
|
627
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
628
|
-
'timeline.editorCannotProvideTimeline',
|
|
629
|
-
"The active editor cannot provide timeline information."
|
|
630
|
-
));
|
|
616
|
+
this.message = ( localizeWithPath(_moduleId, 3, "The active editor cannot provide timeline information."));
|
|
631
617
|
}
|
|
632
618
|
else if (this._isEmpty) {
|
|
633
619
|
if (this.pendingRequests.size !== 0) {
|
|
@@ -636,42 +622,26 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
636
622
|
else {
|
|
637
623
|
this.updateFilename(this.labelService.getUriBasenameLabel(this.uri));
|
|
638
624
|
const scmProviderCount = this.contextKeyService.getContextKeyValue('scm.providerCount');
|
|
639
|
-
if (this.timelineService.getSources().filter(({ id }) => !( this.excludedSources.has(id))).length === 0) {
|
|
640
|
-
this.message = ( localizeWithPath(
|
|
641
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
642
|
-
'timeline.noTimelineSourcesEnabled',
|
|
643
|
-
"All timeline sources have been filtered out."
|
|
644
|
-
));
|
|
625
|
+
if (this.timelineService.getSources().filter(({ id }) => !( (this.excludedSources.has(id)))).length === 0) {
|
|
626
|
+
this.message = ( localizeWithPath(_moduleId, 4, "All timeline sources have been filtered out."));
|
|
645
627
|
}
|
|
646
628
|
else {
|
|
647
|
-
if (this.configurationService.getValue('workbench.localHistory.enabled') && !( this.excludedSources.has('timeline.localHistory'))) {
|
|
629
|
+
if (this.configurationService.getValue('workbench.localHistory.enabled') && !( (this.excludedSources.has('timeline.localHistory')))) {
|
|
648
630
|
this.message = ( localizeWithPath(
|
|
649
|
-
|
|
650
|
-
|
|
631
|
+
_moduleId,
|
|
632
|
+
5,
|
|
651
633
|
"Local History will track recent changes as you save them unless the file has been excluded or is too large."
|
|
652
634
|
));
|
|
653
635
|
}
|
|
654
636
|
else if (this.excludedSources.size > 0) {
|
|
655
|
-
this.message = ( localizeWithPath(
|
|
656
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
657
|
-
'timeline.noTimelineInfoFromEnabledSources',
|
|
658
|
-
"No filtered timeline information was provided."
|
|
659
|
-
));
|
|
637
|
+
this.message = ( localizeWithPath(_moduleId, 6, "No filtered timeline information was provided."));
|
|
660
638
|
}
|
|
661
639
|
else {
|
|
662
|
-
this.message = ( localizeWithPath(
|
|
663
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
664
|
-
'timeline.noTimelineInfo',
|
|
665
|
-
"No timeline information was provided."
|
|
666
|
-
));
|
|
640
|
+
this.message = ( localizeWithPath(_moduleId, 7, "No timeline information was provided."));
|
|
667
641
|
}
|
|
668
642
|
}
|
|
669
643
|
if (!scmProviderCount || scmProviderCount === 0) {
|
|
670
|
-
this.message += ' ' + ( localizeWithPath(
|
|
671
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
672
|
-
'timeline.noSCM',
|
|
673
|
-
"Source Control has not been configured."
|
|
674
|
-
));
|
|
644
|
+
this.message += ' ' + ( localizeWithPath(_moduleId, 8, "Source Control has not been configured."));
|
|
675
645
|
}
|
|
676
646
|
}
|
|
677
647
|
}
|
|
@@ -703,7 +673,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
703
673
|
setVisible(visible) {
|
|
704
674
|
if (visible) {
|
|
705
675
|
this.extensionService.activateByEvent('onView:timeline');
|
|
706
|
-
this.visibilityDisposables = ( new DisposableStore());
|
|
676
|
+
this.visibilityDisposables = ( (new DisposableStore()));
|
|
707
677
|
this.editorService.onDidActiveEditorChange(this.onActiveEditorChanged, this, this.visibilityDisposables);
|
|
708
678
|
this.onDidFocus(() => this.refreshDebounced(), this, this.visibilityDisposables);
|
|
709
679
|
super.setVisible(visible);
|
|
@@ -728,11 +698,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
728
698
|
container.classList.add('tree-explorer-viewlet-tree-view', 'timeline-tree-view');
|
|
729
699
|
this.$message = append(this.$container, $('.message'));
|
|
730
700
|
this.$message.classList.add('timeline-subtle');
|
|
731
|
-
this.message = ( localizeWithPath(
|
|
732
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
733
|
-
'timeline.editorCannotProvideTimeline',
|
|
734
|
-
"The active editor cannot provide timeline information."
|
|
735
|
-
));
|
|
701
|
+
this.message = ( localizeWithPath(_moduleId, 3, "The active editor cannot provide timeline information."));
|
|
736
702
|
this.$tree = document.createElement('div');
|
|
737
703
|
this.$tree.classList.add('customview-tree', 'file-icon-themable-tree', 'hide-arrows');
|
|
738
704
|
container.appendChild(this.$tree);
|
|
@@ -742,16 +708,16 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
742
708
|
this.loadMore(item);
|
|
743
709
|
}
|
|
744
710
|
});
|
|
745
|
-
this.tree = this.instantiationService.createInstance(WorkbenchObjectTree, 'TimelinePane', this.$tree, ( new TimelineListVirtualDelegate()), [this.treeRenderer], {
|
|
746
|
-
identityProvider: ( new TimelineIdentityProvider()),
|
|
711
|
+
this.tree = this.instantiationService.createInstance(WorkbenchObjectTree, 'TimelinePane', this.$tree, ( (new TimelineListVirtualDelegate())), [this.treeRenderer], {
|
|
712
|
+
identityProvider: ( (new TimelineIdentityProvider())),
|
|
747
713
|
accessibilityProvider: {
|
|
748
714
|
getAriaLabel(element) {
|
|
749
715
|
if (isLoadMoreCommand(element)) {
|
|
750
716
|
return element.ariaLabel;
|
|
751
717
|
}
|
|
752
718
|
return element.accessibilityInformation ? element.accessibilityInformation.label : ( localizeWithPath(
|
|
753
|
-
|
|
754
|
-
|
|
719
|
+
_moduleId,
|
|
720
|
+
9,
|
|
755
721
|
"{0}: {1}",
|
|
756
722
|
element.relativeTimeFullWord ?? '',
|
|
757
723
|
element.label
|
|
@@ -764,18 +730,12 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
764
730
|
return element.accessibilityInformation && element.accessibilityInformation.role ? element.accessibilityInformation.role : 'treeitem';
|
|
765
731
|
},
|
|
766
732
|
getWidgetAriaLabel() {
|
|
767
|
-
return ( localizeWithPath(
|
|
768
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
769
|
-
'timeline',
|
|
770
|
-
"Timeline"
|
|
771
|
-
));
|
|
733
|
+
return ( localizeWithPath(_moduleId, 2, "Timeline"));
|
|
772
734
|
}
|
|
773
735
|
},
|
|
774
|
-
keyboardNavigationLabelProvider: ( new TimelineKeyboardNavigationLabelProvider()),
|
|
736
|
+
keyboardNavigationLabelProvider: ( (new TimelineKeyboardNavigationLabelProvider())),
|
|
775
737
|
multipleSelectionSupport: false,
|
|
776
|
-
overrideStyles:
|
|
777
|
-
listBackground: this.getBackgroundColor()
|
|
778
|
-
}
|
|
738
|
+
overrideStyles: this.getLocationBasedColors().listOverrideStyles,
|
|
779
739
|
});
|
|
780
740
|
this._register(this.tree.onContextMenu(e => this.onContextMenu(this.commands, e)));
|
|
781
741
|
this._register(this.tree.onDidChangeSelection(e => this.ensureValidItems()));
|
|
@@ -818,7 +778,9 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
818
778
|
this.loadTimeline(false);
|
|
819
779
|
}
|
|
820
780
|
ensureValidItems() {
|
|
821
|
-
if (!this.hasVisibleItems || !( this.timelineService.getSources().some(
|
|
781
|
+
if (!this.hasVisibleItems || !( (this.timelineService.getSources().some(
|
|
782
|
+
({ id }) => !( (this.excludedSources.has(id))) && ( (this.timelinesBySource.has(id)))
|
|
783
|
+
)))) {
|
|
822
784
|
this.tree.setChildren(null, undefined);
|
|
823
785
|
this._isEmpty = true;
|
|
824
786
|
this.setLoadingUriMessage();
|
|
@@ -829,12 +791,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
829
791
|
setLoadingUriMessage() {
|
|
830
792
|
const file = this.uri && this.labelService.getUriBasenameLabel(this.uri);
|
|
831
793
|
this.updateFilename(file);
|
|
832
|
-
this.message = file ? ( localizeWithPath(
|
|
833
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
834
|
-
'timeline.loading',
|
|
835
|
-
"Loading timeline for {0}...",
|
|
836
|
-
file
|
|
837
|
-
)) : '';
|
|
794
|
+
this.message = file ? ( localizeWithPath(_moduleId, 10, "Loading timeline for {0}...", file)) : '';
|
|
838
795
|
}
|
|
839
796
|
onContextMenu(commands, treeEvent) {
|
|
840
797
|
const item = treeEvent.element;
|
|
@@ -858,7 +815,9 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
858
815
|
getActionViewItem: (action) => {
|
|
859
816
|
const keybinding = this.keybindingService.lookupKeybinding(action.id);
|
|
860
817
|
if (keybinding) {
|
|
861
|
-
return (
|
|
818
|
+
return (
|
|
819
|
+
(new ActionViewItem(action, action, { label: true, keybinding: keybinding.getLabel() }))
|
|
820
|
+
);
|
|
862
821
|
}
|
|
863
822
|
return undefined;
|
|
864
823
|
},
|
|
@@ -868,42 +827,43 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
868
827
|
}
|
|
869
828
|
},
|
|
870
829
|
getActionsContext: () => ({ uri: this.uri, item }),
|
|
871
|
-
actionRunner: ( new TimelineActionRunner())
|
|
830
|
+
actionRunner: ( (new TimelineActionRunner()))
|
|
872
831
|
});
|
|
873
832
|
}
|
|
874
833
|
};
|
|
875
|
-
TimelinePane.__decorator = ( __decorate([
|
|
834
|
+
TimelinePane.__decorator = ( (__decorate([
|
|
876
835
|
debounce(500)
|
|
877
|
-
], TimelinePane.prototype, "refreshDebounced", null));
|
|
878
|
-
TimelinePane = ( __decorate([
|
|
879
|
-
( __param(1, IKeybindingService)),
|
|
880
|
-
( __param(2, IContextMenuService)),
|
|
881
|
-
( __param(3, IContextKeyService)),
|
|
882
|
-
( __param(4, IConfigurationService)),
|
|
883
|
-
( __param(5, IStorageService)),
|
|
884
|
-
( __param(6, IViewDescriptorService)),
|
|
885
|
-
( __param(7, IInstantiationService)),
|
|
886
|
-
( __param(8, IEditorService)),
|
|
887
|
-
( __param(9, ICommandService)),
|
|
888
|
-
( __param(10, IProgressService)),
|
|
889
|
-
( __param(11, ITimelineService)),
|
|
890
|
-
( __param(12, IOpenerService)),
|
|
891
|
-
( __param(13, IThemeService)),
|
|
892
|
-
( __param(14, ITelemetryService)),
|
|
893
|
-
( __param(15,
|
|
894
|
-
( __param(16,
|
|
895
|
-
( __param(17,
|
|
896
|
-
|
|
836
|
+
], TimelinePane.prototype, "refreshDebounced", null)));
|
|
837
|
+
TimelinePane = ( (__decorate([
|
|
838
|
+
( (__param(1, IKeybindingService))),
|
|
839
|
+
( (__param(2, IContextMenuService))),
|
|
840
|
+
( (__param(3, IContextKeyService))),
|
|
841
|
+
( (__param(4, IConfigurationService))),
|
|
842
|
+
( (__param(5, IStorageService))),
|
|
843
|
+
( (__param(6, IViewDescriptorService))),
|
|
844
|
+
( (__param(7, IInstantiationService))),
|
|
845
|
+
( (__param(8, IEditorService))),
|
|
846
|
+
( (__param(9, ICommandService))),
|
|
847
|
+
( (__param(10, IProgressService))),
|
|
848
|
+
( (__param(11, ITimelineService))),
|
|
849
|
+
( (__param(12, IOpenerService))),
|
|
850
|
+
( (__param(13, IThemeService))),
|
|
851
|
+
( (__param(14, ITelemetryService))),
|
|
852
|
+
( (__param(15, IHoverService))),
|
|
853
|
+
( (__param(16, ILabelService))),
|
|
854
|
+
( (__param(17, IUriIdentityService))),
|
|
855
|
+
( (__param(18, IExtensionService)))
|
|
856
|
+
], TimelinePane)));
|
|
897
857
|
class TimelineElementTemplate {
|
|
898
858
|
static { this.id = 'TimelineElementTemplate'; }
|
|
899
859
|
constructor(container, actionViewItemProvider, hoverDelegate) {
|
|
900
860
|
container.classList.add('custom-view-tree-node-item');
|
|
901
861
|
this.icon = append(container, $('.custom-view-tree-node-item-icon'));
|
|
902
|
-
this.iconLabel = ( new IconLabel(container, { supportHighlights: true, supportIcons: true, hoverDelegate }));
|
|
862
|
+
this.iconLabel = ( (new IconLabel(container, { supportHighlights: true, supportIcons: true, hoverDelegate })));
|
|
903
863
|
const timestampContainer = append(this.iconLabel.element, $('.timeline-timestamp-container'));
|
|
904
864
|
this.timestamp = append(timestampContainer, $('span.timeline-timestamp'));
|
|
905
865
|
const actionsContainer = append(this.iconLabel.element, $('.actions'));
|
|
906
|
-
this.actionBar = ( new ActionBar(actionsContainer, { actionViewItemProvider }));
|
|
866
|
+
this.actionBar = ( (new ActionBar(actionsContainer, { actionViewItemProvider })));
|
|
907
867
|
}
|
|
908
868
|
dispose() {
|
|
909
869
|
this.iconLabel.dispose();
|
|
@@ -952,7 +912,7 @@ let TimelineTreeRenderer = class TimelineTreeRenderer {
|
|
|
952
912
|
this.commands = commands;
|
|
953
913
|
this.instantiationService = instantiationService;
|
|
954
914
|
this.themeService = themeService;
|
|
955
|
-
this._onDidScrollToEnd = ( new Emitter());
|
|
915
|
+
this._onDidScrollToEnd = ( (new Emitter()));
|
|
956
916
|
this.onDidScrollToEnd = this._onDidScrollToEnd.event;
|
|
957
917
|
this.templateId = TimelineElementTemplate.id;
|
|
958
918
|
this.actionViewItemProvider = createActionViewItem.bind(undefined, this.instantiationService);
|
|
@@ -962,7 +922,9 @@ let TimelineTreeRenderer = class TimelineTreeRenderer {
|
|
|
962
922
|
this.uri = uri;
|
|
963
923
|
}
|
|
964
924
|
renderTemplate(container) {
|
|
965
|
-
return (
|
|
925
|
+
return (
|
|
926
|
+
(new TimelineElementTemplate(container, this.actionViewItemProvider, this._hoverDelegate))
|
|
927
|
+
);
|
|
966
928
|
}
|
|
967
929
|
renderElement(node, index, template, height) {
|
|
968
930
|
template.reset();
|
|
@@ -1003,7 +965,7 @@ let TimelineTreeRenderer = class TimelineTreeRenderer {
|
|
|
1003
965
|
template.timestamp.ariaLabel = item.relativeTimeFullWord ?? '';
|
|
1004
966
|
template.timestamp.parentElement.classList.toggle('timeline-timestamp--duplicate', isTimelineItem(item) && item.hideRelativeTime);
|
|
1005
967
|
template.actionBar.context = { uri: this.uri, item };
|
|
1006
|
-
template.actionBar.actionRunner = ( new TimelineActionRunner());
|
|
968
|
+
template.actionBar.actionRunner = ( (new TimelineActionRunner()));
|
|
1007
969
|
template.actionBar.push(this.commands.getItemActions(item), { icon: true, label: false });
|
|
1008
970
|
if (isLoadMoreCommand(item)) {
|
|
1009
971
|
setTimeout(() => this._onDidScrollToEnd.fire(item), 0);
|
|
@@ -1013,25 +975,13 @@ let TimelineTreeRenderer = class TimelineTreeRenderer {
|
|
|
1013
975
|
template.dispose();
|
|
1014
976
|
}
|
|
1015
977
|
};
|
|
1016
|
-
TimelineTreeRenderer = ( __decorate([
|
|
1017
|
-
( __param(1, IInstantiationService)),
|
|
1018
|
-
( __param(2, IThemeService))
|
|
1019
|
-
], TimelineTreeRenderer));
|
|
1020
|
-
const timelineRefresh = registerIcon('timeline-refresh', Codicon.refresh, ( localizeWithPath(
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
'Icon for the refresh timeline action.'
|
|
1024
|
-
)));
|
|
1025
|
-
const timelinePin = registerIcon('timeline-pin', Codicon.pin, ( localizeWithPath(
|
|
1026
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
1027
|
-
'timelinePin',
|
|
1028
|
-
'Icon for the pin timeline action.'
|
|
1029
|
-
)));
|
|
1030
|
-
const timelineUnpin = registerIcon('timeline-unpin', Codicon.pinned, ( localizeWithPath(
|
|
1031
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
1032
|
-
'timelineUnpin',
|
|
1033
|
-
'Icon for the unpin timeline action.'
|
|
1034
|
-
)));
|
|
978
|
+
TimelineTreeRenderer = ( (__decorate([
|
|
979
|
+
( (__param(1, IInstantiationService))),
|
|
980
|
+
( (__param(2, IThemeService)))
|
|
981
|
+
], TimelineTreeRenderer)));
|
|
982
|
+
const timelineRefresh = registerIcon('timeline-refresh', Codicon.refresh, ( localizeWithPath(_moduleId, 11, 'Icon for the refresh timeline action.')));
|
|
983
|
+
const timelinePin = registerIcon('timeline-pin', Codicon.pin, ( localizeWithPath(_moduleId, 12, 'Icon for the pin timeline action.')));
|
|
984
|
+
const timelineUnpin = registerIcon('timeline-unpin', Codicon.pinned, ( localizeWithPath(_moduleId, 13, 'Icon for the unpin timeline action.')));
|
|
1035
985
|
let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
1036
986
|
constructor(pane, timelineService, storageService, contextKeyService, menuService) {
|
|
1037
987
|
super();
|
|
@@ -1040,18 +990,14 @@ let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
|
1040
990
|
this.storageService = storageService;
|
|
1041
991
|
this.contextKeyService = contextKeyService;
|
|
1042
992
|
this.menuService = menuService;
|
|
1043
|
-
this._register(this.sourceDisposables = ( new DisposableStore()));
|
|
993
|
+
this._register(this.sourceDisposables = ( (new DisposableStore())));
|
|
1044
994
|
this._register(registerAction2(class extends Action2 {
|
|
1045
995
|
constructor() {
|
|
1046
996
|
super({
|
|
1047
997
|
id: 'timeline.refresh',
|
|
1048
|
-
title: ( localize2WithPath(
|
|
998
|
+
title: ( localize2WithPath(_moduleId, 14, "Refresh")),
|
|
1049
999
|
icon: timelineRefresh,
|
|
1050
|
-
category: ( localize2WithPath(
|
|
1051
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
1052
|
-
'timeline',
|
|
1053
|
-
"Timeline"
|
|
1054
|
-
)),
|
|
1000
|
+
category: ( localize2WithPath(_moduleId, 2, "Timeline")),
|
|
1055
1001
|
menu: {
|
|
1056
1002
|
id: MenuId.TimelineTitle,
|
|
1057
1003
|
group: 'navigation',
|
|
@@ -1067,17 +1013,9 @@ let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
|
1067
1013
|
this._register(MenuRegistry.appendMenuItem(MenuId.TimelineTitle, ({
|
|
1068
1014
|
command: {
|
|
1069
1015
|
id: 'timeline.toggleFollowActiveEditor',
|
|
1070
|
-
title: ( localize2WithPath(
|
|
1071
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
1072
|
-
'timeline.toggleFollowActiveEditorCommand.follow',
|
|
1073
|
-
'Pin the Current Timeline'
|
|
1074
|
-
)),
|
|
1016
|
+
title: ( localize2WithPath(_moduleId, 15, 'Pin the Current Timeline')),
|
|
1075
1017
|
icon: timelinePin,
|
|
1076
|
-
category: ( localize2WithPath(
|
|
1077
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
1078
|
-
'timeline',
|
|
1079
|
-
"Timeline"
|
|
1080
|
-
)),
|
|
1018
|
+
category: ( localize2WithPath(_moduleId, 2, "Timeline")),
|
|
1081
1019
|
},
|
|
1082
1020
|
group: 'navigation',
|
|
1083
1021
|
order: 98,
|
|
@@ -1086,21 +1024,13 @@ let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
|
1086
1024
|
this._register(MenuRegistry.appendMenuItem(MenuId.TimelineTitle, ({
|
|
1087
1025
|
command: {
|
|
1088
1026
|
id: 'timeline.toggleFollowActiveEditor',
|
|
1089
|
-
title: ( localize2WithPath(
|
|
1090
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
1091
|
-
'timeline.toggleFollowActiveEditorCommand.unfollow',
|
|
1092
|
-
'Unpin the Current Timeline'
|
|
1093
|
-
)),
|
|
1027
|
+
title: ( localize2WithPath(_moduleId, 16, 'Unpin the Current Timeline')),
|
|
1094
1028
|
icon: timelineUnpin,
|
|
1095
|
-
category: ( localize2WithPath(
|
|
1096
|
-
'vs/workbench/contrib/timeline/browser/timelinePane',
|
|
1097
|
-
'timeline',
|
|
1098
|
-
"Timeline"
|
|
1099
|
-
)),
|
|
1029
|
+
category: ( localize2WithPath(_moduleId, 2, "Timeline")),
|
|
1100
1030
|
},
|
|
1101
1031
|
group: 'navigation',
|
|
1102
1032
|
order: 98,
|
|
1103
|
-
when: ( TimelineFollowActiveEditorContext.toNegated())
|
|
1033
|
+
when: ( (TimelineFollowActiveEditorContext.toNegated()))
|
|
1104
1034
|
})));
|
|
1105
1035
|
this._register(timelineService.onDidChangeProviders(() => this.updateTimelineSourceFilters()));
|
|
1106
1036
|
this.updateTimelineSourceFilters();
|
|
@@ -1126,9 +1056,9 @@ let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
|
1126
1056
|
}
|
|
1127
1057
|
updateTimelineSourceFilters() {
|
|
1128
1058
|
this.sourceDisposables.clear();
|
|
1129
|
-
const excluded = ( new Set(
|
|
1059
|
+
const excluded = ( (new Set(
|
|
1130
1060
|
JSON.parse(this.storageService.get('timeline.excludeSources', 0 , '[]'))
|
|
1131
|
-
));
|
|
1061
|
+
)));
|
|
1132
1062
|
for (const source of this.timelineService.getSources()) {
|
|
1133
1063
|
this.sourceDisposables.add(registerAction2(class extends Action2 {
|
|
1134
1064
|
constructor() {
|
|
@@ -1139,28 +1069,31 @@ let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
|
1139
1069
|
id: MenuId.TimelineFilterSubMenu,
|
|
1140
1070
|
group: 'navigation',
|
|
1141
1071
|
},
|
|
1142
|
-
toggled: ( ( ContextKeyExpr.regex(
|
|
1072
|
+
toggled: ( (( (ContextKeyExpr.regex(
|
|
1073
|
+
`timelineExcludeSources`,
|
|
1074
|
+
(new RegExp(`\\b${escapeRegExpCharacters(source.id)}\\b`))
|
|
1075
|
+
))).negate()))
|
|
1143
1076
|
});
|
|
1144
1077
|
}
|
|
1145
1078
|
run(accessor, ...args) {
|
|
1146
|
-
if (( excluded.has(source.id))) {
|
|
1079
|
+
if (( (excluded.has(source.id)))) {
|
|
1147
1080
|
excluded.delete(source.id);
|
|
1148
1081
|
}
|
|
1149
1082
|
else {
|
|
1150
1083
|
excluded.add(source.id);
|
|
1151
1084
|
}
|
|
1152
1085
|
const storageService = accessor.get(IStorageService);
|
|
1153
|
-
storageService.store('timeline.excludeSources', JSON.stringify([...( excluded.keys())]), 0 , 0 );
|
|
1086
|
+
storageService.store('timeline.excludeSources', JSON.stringify([...( (excluded.keys()))]), 0 , 0 );
|
|
1154
1087
|
}
|
|
1155
1088
|
}));
|
|
1156
1089
|
}
|
|
1157
1090
|
}
|
|
1158
1091
|
};
|
|
1159
|
-
TimelinePaneCommands = ( __decorate([
|
|
1160
|
-
( __param(1, ITimelineService)),
|
|
1161
|
-
( __param(2, IStorageService)),
|
|
1162
|
-
( __param(3, IContextKeyService)),
|
|
1163
|
-
( __param(4, IMenuService))
|
|
1164
|
-
], TimelinePaneCommands));
|
|
1092
|
+
TimelinePaneCommands = ( (__decorate([
|
|
1093
|
+
( (__param(1, ITimelineService))),
|
|
1094
|
+
( (__param(2, IStorageService))),
|
|
1095
|
+
( (__param(3, IContextKeyService))),
|
|
1096
|
+
( (__param(4, IMenuService)))
|
|
1097
|
+
], TimelinePaneCommands)));
|
|
1165
1098
|
|
|
1166
1099
|
export { TimelineExcludeSources, TimelineFollowActiveEditorContext, TimelineIdentityProvider, TimelineKeyboardNavigationLabelProvider, TimelineListVirtualDelegate, TimelinePane };
|