@codingame/monaco-vscode-timeline-service-override 7.0.11 → 7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/localHistory/browser/localHistory.js +3 -4
- package/vscode/src/vs/workbench/contrib/localHistory/browser/localHistoryCommands.js +47 -60
- package/vscode/src/vs/workbench/contrib/localHistory/browser/localHistoryTimeline.js +2 -3
- package/vscode/src/vs/workbench/contrib/timeline/browser/timeline.contribution.js +11 -14
- package/vscode/src/vs/workbench/contrib/timeline/browser/timelinePane.js +25 -34
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-timeline-service-override",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@7.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@7.1.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
2
2
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
3
3
|
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";
|
|
8
7
|
let localHistoryDateFormatter = undefined;
|
|
9
8
|
function getLocalHistoryDateFormatter() {
|
|
10
9
|
if (!localHistoryDateFormatter) {
|
|
@@ -24,7 +23,7 @@ function getLocalHistoryDateFormatter() {
|
|
|
24
23
|
}
|
|
25
24
|
const LOCAL_HISTORY_MENU_CONTEXT_VALUE = 'localHistory:item';
|
|
26
25
|
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, (
|
|
28
|
-
const LOCAL_HISTORY_ICON_RESTORE = registerIcon('localHistory-restore', Codicon.check, (
|
|
26
|
+
const LOCAL_HISTORY_ICON_ENTRY = registerIcon('localHistory-icon', Codicon.circleOutline, ( localize(10540, "Icon for a local history entry in the timeline view.")));
|
|
27
|
+
const LOCAL_HISTORY_ICON_RESTORE = registerIcon('localHistory-restore', Codicon.check, ( localize(10541, "Icon for restoring contents of a local history entry.")));
|
|
29
28
|
|
|
30
29
|
export { LOCAL_HISTORY_ICON_ENTRY, LOCAL_HISTORY_ICON_RESTORE, LOCAL_HISTORY_MENU_CONTEXT_KEY, LOCAL_HISTORY_MENU_CONTEXT_VALUE, getLocalHistoryDateFormatter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { localize2, localize } from 'vscode/vscode/vs/nls';
|
|
2
2
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
3
3
|
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
4
4
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
@@ -7,7 +7,7 @@ import { CancellationToken, CancellationTokenSource } from 'vscode/vscode/vs/bas
|
|
|
7
7
|
import { IWorkingCopyHistoryService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyHistory.service';
|
|
8
8
|
import { API_OPEN_DIFF_EDITOR_COMMAND_ID } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
9
9
|
import { LocalHistoryFileSystemProvider } from './localHistoryFileSystemProvider.js';
|
|
10
|
-
import {
|
|
10
|
+
import { ContextKeyExpr, RawContextKey } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
11
11
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
12
12
|
import { registerAction2, Action2, MenuId, MenuRegistry } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
13
13
|
import { basenameOrAuthority, basename, dirname } from 'vscode/vscode/vs/base/common/resources';
|
|
@@ -27,9 +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
|
-
const
|
|
32
|
-
const COMPARE_WITH_FILE_LABEL = (
|
|
30
|
+
const LOCAL_HISTORY_CATEGORY = ( localize2(6786, 'Local History'));
|
|
31
|
+
const CTX_LOCAL_HISTORY_ENABLED = ( (ContextKeyExpr.has('config.workbench.localHistory.enabled')));
|
|
32
|
+
const COMPARE_WITH_FILE_LABEL = ( localize2(6787, 'Compare with File'));
|
|
33
33
|
registerAction2(class extends Action2 {
|
|
34
34
|
constructor() {
|
|
35
35
|
super({
|
|
@@ -56,7 +56,7 @@ registerAction2(class extends Action2 {
|
|
|
56
56
|
constructor() {
|
|
57
57
|
super({
|
|
58
58
|
id: 'workbench.action.localHistory.compareWithPrevious',
|
|
59
|
-
title: (
|
|
59
|
+
title: ( localize2(6788, 'Compare with Previous')),
|
|
60
60
|
menu: {
|
|
61
61
|
id: MenuId.TimelineItemContext,
|
|
62
62
|
group: '1_compare',
|
|
@@ -84,7 +84,7 @@ registerAction2(class extends Action2 {
|
|
|
84
84
|
constructor() {
|
|
85
85
|
super({
|
|
86
86
|
id: 'workbench.action.localHistory.selectForCompare',
|
|
87
|
-
title: (
|
|
87
|
+
title: ( localize2(6789, 'Select for Compare')),
|
|
88
88
|
menu: {
|
|
89
89
|
id: MenuId.TimelineItemContext,
|
|
90
90
|
group: '2_compare_with',
|
|
@@ -107,7 +107,7 @@ registerAction2(class extends Action2 {
|
|
|
107
107
|
constructor() {
|
|
108
108
|
super({
|
|
109
109
|
id: 'workbench.action.localHistory.compareWithSelected',
|
|
110
|
-
title: (
|
|
110
|
+
title: ( localize2(6790, 'Compare with Selected')),
|
|
111
111
|
menu: {
|
|
112
112
|
id: MenuId.TimelineItemContext,
|
|
113
113
|
group: '2_compare_with',
|
|
@@ -136,7 +136,7 @@ registerAction2(class extends Action2 {
|
|
|
136
136
|
constructor() {
|
|
137
137
|
super({
|
|
138
138
|
id: 'workbench.action.localHistory.open',
|
|
139
|
-
title: (
|
|
139
|
+
title: ( localize2(6791, 'Show Contents')),
|
|
140
140
|
menu: {
|
|
141
141
|
id: MenuId.TimelineItemContext,
|
|
142
142
|
group: '3_contents',
|
|
@@ -154,7 +154,7 @@ registerAction2(class extends Action2 {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
|
-
const RESTORE_CONTENTS_LABEL = (
|
|
157
|
+
const RESTORE_CONTENTS_LABEL = ( localize2(6792, 'Restore Contents'));
|
|
158
158
|
registerAction2(class extends Action2 {
|
|
159
159
|
constructor() {
|
|
160
160
|
super({
|
|
@@ -191,7 +191,7 @@ registerAction2(class extends Action2 {
|
|
|
191
191
|
return restore(accessor, item);
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
|
-
const restoreSaveSource = SaveSourceRegistry.registerSource('localHistoryRestore.source', (
|
|
194
|
+
const restoreSaveSource = SaveSourceRegistry.registerSource('localHistoryRestore.source', ( localize(6793, "File Restored")));
|
|
195
195
|
async function restore(accessor, item) {
|
|
196
196
|
const fileService = accessor.get(IFileService);
|
|
197
197
|
const dialogService = accessor.get(IDialogService);
|
|
@@ -202,14 +202,13 @@ async function restore(accessor, item) {
|
|
|
202
202
|
if (entry) {
|
|
203
203
|
const { confirmed } = await dialogService.confirm({
|
|
204
204
|
type: 'warning',
|
|
205
|
-
message: (
|
|
206
|
-
|
|
207
|
-
8,
|
|
205
|
+
message: ( localize(
|
|
206
|
+
6794,
|
|
208
207
|
"Do you want to restore the contents of '{0}'?",
|
|
209
208
|
basename(entry.workingCopy.resource)
|
|
210
209
|
)),
|
|
211
|
-
detail: (
|
|
212
|
-
primaryButton: (
|
|
210
|
+
detail: ( localize(6795, "Restoring will discard any unsaved changes.")),
|
|
211
|
+
primaryButton: ( localize(6796, "&&Restore"))
|
|
213
212
|
});
|
|
214
213
|
if (!confirmed) {
|
|
215
214
|
return;
|
|
@@ -226,12 +225,7 @@ async function restore(accessor, item) {
|
|
|
226
225
|
await fileService.cloneFile(entry.location, entry.workingCopy.resource);
|
|
227
226
|
}
|
|
228
227
|
catch (error) {
|
|
229
|
-
await dialogService.error((
|
|
230
|
-
_moduleId,
|
|
231
|
-
11,
|
|
232
|
-
"Unable to restore '{0}'.",
|
|
233
|
-
basename(entry.workingCopy.resource)
|
|
234
|
-
)), toErrorMessage(error));
|
|
228
|
+
await dialogService.error(( localize(6797, "Unable to restore '{0}'.", basename(entry.workingCopy.resource))), toErrorMessage(error));
|
|
235
229
|
return;
|
|
236
230
|
}
|
|
237
231
|
if (workingCopies) {
|
|
@@ -251,9 +245,10 @@ registerAction2(class extends Action2 {
|
|
|
251
245
|
constructor() {
|
|
252
246
|
super({
|
|
253
247
|
id: 'workbench.action.localHistory.restoreViaPicker',
|
|
254
|
-
title: (
|
|
248
|
+
title: ( localize2(6798, 'Find Entry to Restore')),
|
|
255
249
|
f1: true,
|
|
256
|
-
category: LOCAL_HISTORY_CATEGORY
|
|
250
|
+
category: LOCAL_HISTORY_CATEGORY,
|
|
251
|
+
precondition: CTX_LOCAL_HISTORY_ENABLED
|
|
257
252
|
});
|
|
258
253
|
}
|
|
259
254
|
async run(accessor) {
|
|
@@ -272,7 +267,7 @@ registerAction2(class extends Action2 {
|
|
|
272
267
|
resourcePicker.show();
|
|
273
268
|
const resources = await workingCopyHistoryService.getAll(cts.token);
|
|
274
269
|
resourcePicker.busy = false;
|
|
275
|
-
resourcePicker.placeholder = (
|
|
270
|
+
resourcePicker.placeholder = ( localize(6799, "Select the file to show local history for"));
|
|
276
271
|
resourcePicker.matchOnLabel = true;
|
|
277
272
|
resourcePicker.matchOnDescription = true;
|
|
278
273
|
resourcePicker.items = ( (resources.map(resource => ({
|
|
@@ -294,7 +289,7 @@ registerAction2(class extends Action2 {
|
|
|
294
289
|
entryPicker.show();
|
|
295
290
|
const entries = await workingCopyHistoryService.getEntries(resource, cts.token);
|
|
296
291
|
entryPicker.busy = false;
|
|
297
|
-
entryPicker.placeholder = (
|
|
292
|
+
entryPicker.placeholder = ( localize(6800, "Select the local history entry to open"));
|
|
298
293
|
entryPicker.matchOnLabel = true;
|
|
299
294
|
entryPicker.matchOnDescription = true;
|
|
300
295
|
entryPicker.items = ( (Array.from(entries).reverse().map(entry => ({
|
|
@@ -315,12 +310,12 @@ registerAction2(class extends Action2 {
|
|
|
315
310
|
return openEntry(selectedItem.entry, editorService);
|
|
316
311
|
}
|
|
317
312
|
});
|
|
318
|
-
MenuRegistry.appendMenuItem(MenuId.TimelineTitle, { command: { id: 'workbench.action.localHistory.restoreViaPicker', title: (
|
|
313
|
+
MenuRegistry.appendMenuItem(MenuId.TimelineTitle, { command: { id: 'workbench.action.localHistory.restoreViaPicker', title: ( localize2(6801, 'Local History: Find Entry to Restore...')) }, group: 'submenu', order: 1, when: CTX_LOCAL_HISTORY_ENABLED });
|
|
319
314
|
registerAction2(class extends Action2 {
|
|
320
315
|
constructor() {
|
|
321
316
|
super({
|
|
322
317
|
id: 'workbench.action.localHistory.rename',
|
|
323
|
-
title: (
|
|
318
|
+
title: ( localize2(6802, 'Rename')),
|
|
324
319
|
menu: {
|
|
325
320
|
id: MenuId.TimelineItemContext,
|
|
326
321
|
group: '5_edit',
|
|
@@ -335,9 +330,9 @@ registerAction2(class extends Action2 {
|
|
|
335
330
|
const { entry } = await findLocalHistoryEntry(workingCopyHistoryService, item);
|
|
336
331
|
if (entry) {
|
|
337
332
|
const inputBox = quickInputService.createInputBox();
|
|
338
|
-
inputBox.title = (
|
|
333
|
+
inputBox.title = ( localize(6803, "Rename Local History Entry"));
|
|
339
334
|
inputBox.ignoreFocusOut = true;
|
|
340
|
-
inputBox.placeholder = (
|
|
335
|
+
inputBox.placeholder = ( localize(6804, "Enter the new name of the local history entry"));
|
|
341
336
|
inputBox.value = SaveSourceRegistry.getSourceLabel(entry.source);
|
|
342
337
|
inputBox.show();
|
|
343
338
|
inputBox.onDidAccept(() => {
|
|
@@ -353,7 +348,7 @@ registerAction2(class extends Action2 {
|
|
|
353
348
|
constructor() {
|
|
354
349
|
super({
|
|
355
350
|
id: 'workbench.action.localHistory.delete',
|
|
356
|
-
title: (
|
|
351
|
+
title: ( localize2(6805, 'Delete')),
|
|
357
352
|
menu: {
|
|
358
353
|
id: MenuId.TimelineItemContext,
|
|
359
354
|
group: '5_edit',
|
|
@@ -370,15 +365,14 @@ registerAction2(class extends Action2 {
|
|
|
370
365
|
if (entry) {
|
|
371
366
|
const { confirmed } = await dialogService.confirm({
|
|
372
367
|
type: 'warning',
|
|
373
|
-
message: (
|
|
374
|
-
|
|
375
|
-
20,
|
|
368
|
+
message: ( localize(
|
|
369
|
+
6806,
|
|
376
370
|
"Do you want to delete the local history entry of '{0}' from {1}?",
|
|
377
371
|
entry.workingCopy.name,
|
|
378
372
|
toLocalHistoryEntryDateLabel(entry.timestamp)
|
|
379
373
|
)),
|
|
380
|
-
detail: (
|
|
381
|
-
primaryButton: (
|
|
374
|
+
detail: ( localize(6807, "This action is irreversible!")),
|
|
375
|
+
primaryButton: ( localize(6808, "&&Delete")),
|
|
382
376
|
});
|
|
383
377
|
if (!confirmed) {
|
|
384
378
|
return;
|
|
@@ -392,9 +386,10 @@ registerAction2(class extends Action2 {
|
|
|
392
386
|
constructor() {
|
|
393
387
|
super({
|
|
394
388
|
id: 'workbench.action.localHistory.deleteAll',
|
|
395
|
-
title: (
|
|
389
|
+
title: ( localize2(6809, 'Delete All')),
|
|
396
390
|
f1: true,
|
|
397
|
-
category: LOCAL_HISTORY_CATEGORY
|
|
391
|
+
category: LOCAL_HISTORY_CATEGORY,
|
|
392
|
+
precondition: CTX_LOCAL_HISTORY_ENABLED
|
|
398
393
|
});
|
|
399
394
|
}
|
|
400
395
|
async run(accessor) {
|
|
@@ -402,13 +397,9 @@ registerAction2(class extends Action2 {
|
|
|
402
397
|
const workingCopyHistoryService = accessor.get(IWorkingCopyHistoryService);
|
|
403
398
|
const { confirmed } = await dialogService.confirm({
|
|
404
399
|
type: 'warning',
|
|
405
|
-
message: (
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
"Do you want to delete all entries of all files in local history?"
|
|
409
|
-
)),
|
|
410
|
-
detail: ( localizeWithPath(_moduleId, 25, "This action is irreversible!")),
|
|
411
|
-
primaryButton: ( localizeWithPath(_moduleId, 26, "&&Delete All")),
|
|
400
|
+
message: ( localize(6810, "Do you want to delete all entries of all files in local history?")),
|
|
401
|
+
detail: ( localize(6811, "This action is irreversible!")),
|
|
402
|
+
primaryButton: ( localize(6812, "&&Delete All")),
|
|
412
403
|
});
|
|
413
404
|
if (!confirmed) {
|
|
414
405
|
return;
|
|
@@ -420,10 +411,10 @@ registerAction2(class extends Action2 {
|
|
|
420
411
|
constructor() {
|
|
421
412
|
super({
|
|
422
413
|
id: 'workbench.action.localHistory.create',
|
|
423
|
-
title: (
|
|
414
|
+
title: ( localize2(6813, 'Create Entry')),
|
|
424
415
|
f1: true,
|
|
425
416
|
category: LOCAL_HISTORY_CATEGORY,
|
|
426
|
-
precondition: ActiveEditorContext
|
|
417
|
+
precondition: ( (ContextKeyExpr.and(CTX_LOCAL_HISTORY_ENABLED, ActiveEditorContext)))
|
|
427
418
|
});
|
|
428
419
|
}
|
|
429
420
|
async run(accessor) {
|
|
@@ -437,11 +428,10 @@ registerAction2(class extends Action2 {
|
|
|
437
428
|
return;
|
|
438
429
|
}
|
|
439
430
|
const inputBox = quickInputService.createInputBox();
|
|
440
|
-
inputBox.title = (
|
|
431
|
+
inputBox.title = ( localize(6814, "Create Local History Entry"));
|
|
441
432
|
inputBox.ignoreFocusOut = true;
|
|
442
|
-
inputBox.placeholder = (
|
|
443
|
-
|
|
444
|
-
29,
|
|
433
|
+
inputBox.placeholder = ( localize(
|
|
434
|
+
6815,
|
|
445
435
|
"Enter the new name of the local history entry for '{0}'",
|
|
446
436
|
labelService.getUriBasenameLabel(resource)
|
|
447
437
|
));
|
|
@@ -459,9 +449,8 @@ async function openEntry(entry, editorService) {
|
|
|
459
449
|
const resource = LocalHistoryFileSystemProvider.toLocalHistoryFileSystem({ location: entry.location, associatedResource: entry.workingCopy.resource });
|
|
460
450
|
await editorService.openEditor({
|
|
461
451
|
resource,
|
|
462
|
-
label: (
|
|
463
|
-
|
|
464
|
-
30,
|
|
452
|
+
label: ( localize(
|
|
453
|
+
6816,
|
|
465
454
|
"{0} ({1} • {2})",
|
|
466
455
|
entry.workingCopy.name,
|
|
467
456
|
SaveSourceRegistry.getSourceLabel(entry.source),
|
|
@@ -481,9 +470,8 @@ function toDiffEditorArguments(arg1, arg2) {
|
|
|
481
470
|
if (URI.isUri(arg2)) {
|
|
482
471
|
const resource = arg2;
|
|
483
472
|
modifiedResource = resource;
|
|
484
|
-
label = (
|
|
485
|
-
|
|
486
|
-
31,
|
|
473
|
+
label = ( localize(
|
|
474
|
+
6817,
|
|
487
475
|
"{0} ({1} • {2}) ↔ {3}",
|
|
488
476
|
arg1.workingCopy.name,
|
|
489
477
|
SaveSourceRegistry.getSourceLabel(arg1.source),
|
|
@@ -494,9 +482,8 @@ function toDiffEditorArguments(arg1, arg2) {
|
|
|
494
482
|
else {
|
|
495
483
|
const modified = arg2;
|
|
496
484
|
modifiedResource = LocalHistoryFileSystemProvider.toLocalHistoryFileSystem({ location: modified.location, associatedResource: modified.workingCopy.resource });
|
|
497
|
-
label = (
|
|
498
|
-
|
|
499
|
-
32,
|
|
485
|
+
label = ( localize(
|
|
486
|
+
6818,
|
|
500
487
|
"{0} ({1} • {2}) ↔ {3} ({4} • {5})",
|
|
501
488
|
arg1.workingCopy.name,
|
|
502
489
|
SaveSourceRegistry.getSourceLabel(arg1.source),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import {
|
|
2
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
4
4
|
import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
5
|
import { ITimelineService } from 'vscode/vscode/vs/workbench/contrib/timeline/common/timeline.service';
|
|
@@ -20,7 +20,6 @@ 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";
|
|
24
23
|
let LocalHistoryTimeline = class LocalHistoryTimeline extends Disposable {
|
|
25
24
|
static { LocalHistoryTimeline_1 = this; }
|
|
26
25
|
static { this.ID = 'workbench.contrib.localHistoryTimeline'; }
|
|
@@ -35,7 +34,7 @@ let LocalHistoryTimeline = class LocalHistoryTimeline extends Disposable {
|
|
|
35
34
|
this.configurationService = configurationService;
|
|
36
35
|
this.contextService = contextService;
|
|
37
36
|
this.id = 'timeline.localHistory';
|
|
38
|
-
this.label = (
|
|
37
|
+
this.label = ( localize(6819, "Local History"));
|
|
39
38
|
this.scheme = '*';
|
|
40
39
|
this._onDidChange = this._register(( (new Emitter())));
|
|
41
40
|
this.onDidChange = this._onDidChange.event;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
2
2
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
3
3
|
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
4
4
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
@@ -17,9 +17,8 @@ import { ResourceContextKey } from 'vscode/vscode/vs/workbench/common/contextkey
|
|
|
17
17
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
18
18
|
import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
19
19
|
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const timelineOpenIcon = registerIcon('timeline-open', Codicon.history, ( localizeWithPath(_moduleId, 1, 'Icon for the open timeline action.')));
|
|
20
|
+
const timelineViewIcon = registerIcon('timeline-view-icon', Codicon.history, ( localize(3014, 'View icon of the timeline view.')));
|
|
21
|
+
const timelineOpenIcon = registerIcon('timeline-open', Codicon.history, ( localize(3015, 'Icon for the open timeline action.')));
|
|
23
22
|
class TimelinePaneDescriptor {
|
|
24
23
|
constructor() {
|
|
25
24
|
this.id = TimelinePaneId;
|
|
@@ -40,24 +39,22 @@ const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
|
|
|
40
39
|
configurationRegistry.registerConfiguration({
|
|
41
40
|
id: 'timeline',
|
|
42
41
|
order: 1001,
|
|
43
|
-
title: (
|
|
42
|
+
title: ( localize(3016, "Timeline")),
|
|
44
43
|
type: 'object',
|
|
45
44
|
properties: {
|
|
46
45
|
'timeline.pageSize': {
|
|
47
46
|
type: ['number', 'null'],
|
|
48
47
|
default: null,
|
|
49
|
-
markdownDescription: (
|
|
50
|
-
|
|
51
|
-
3,
|
|
48
|
+
markdownDescription: ( localize(
|
|
49
|
+
3017,
|
|
52
50
|
"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."
|
|
53
51
|
)),
|
|
54
52
|
},
|
|
55
53
|
'timeline.pageOnScroll': {
|
|
56
54
|
type: 'boolean',
|
|
57
55
|
default: false,
|
|
58
|
-
description: (
|
|
59
|
-
|
|
60
|
-
4,
|
|
56
|
+
description: ( localize(
|
|
57
|
+
3018,
|
|
61
58
|
"Experimental. Controls whether the Timeline view will load the next page of items when you scroll to the end of the list."
|
|
62
59
|
)),
|
|
63
60
|
},
|
|
@@ -67,7 +64,7 @@ configurationRegistry.registerConfiguration({
|
|
|
67
64
|
var OpenTimelineAction;
|
|
68
65
|
( ((function(OpenTimelineAction) {
|
|
69
66
|
OpenTimelineAction.ID = 'files.openTimeline';
|
|
70
|
-
OpenTimelineAction.LABEL = (
|
|
67
|
+
OpenTimelineAction.LABEL = ( localize(3019, "Open Timeline"));
|
|
71
68
|
function handler() {
|
|
72
69
|
return (accessor, arg) => {
|
|
73
70
|
const service = accessor.get(ITimelineService);
|
|
@@ -91,10 +88,10 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, ({
|
|
|
91
88
|
TimelineHasProviderContext
|
|
92
89
|
)))
|
|
93
90
|
}));
|
|
94
|
-
const timelineFilter = registerIcon('timeline-filter', Codicon.filter, (
|
|
91
|
+
const timelineFilter = registerIcon('timeline-filter', Codicon.filter, ( localize(3020, 'Icon for the filter timeline action.')));
|
|
95
92
|
MenuRegistry.appendMenuItem(MenuId.TimelineTitle, {
|
|
96
93
|
submenu: MenuId.TimelineFilterSubMenu,
|
|
97
|
-
title: (
|
|
94
|
+
title: ( localize(3021, "Filter Timeline")),
|
|
98
95
|
group: 'navigation',
|
|
99
96
|
order: 100,
|
|
100
97
|
icon: timelineFilter
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import './media/timelinePane.css.js';
|
|
3
|
-
import {
|
|
3
|
+
import { localize, localize2 } from 'vscode/vscode/vs/nls';
|
|
4
4
|
import { clearNode, append, $, asCSSUrl } from 'vscode/vscode/vs/base/browser/dom';
|
|
5
5
|
import { ActionRunner } from 'vscode/vscode/vs/base/common/actions';
|
|
6
6
|
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
@@ -53,7 +53,6 @@ import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storag
|
|
|
53
53
|
import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
54
54
|
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
55
55
|
|
|
56
|
-
const _moduleId = "vs/workbench/contrib/timeline/browser/timelinePane";
|
|
57
56
|
const ItemHeight = 22;
|
|
58
57
|
function isLoadMoreCommand(item) {
|
|
59
58
|
return item instanceof LoadMoreCommand;
|
|
@@ -176,7 +175,7 @@ class LoadMoreCommand {
|
|
|
176
175
|
return this.label;
|
|
177
176
|
}
|
|
178
177
|
get label() {
|
|
179
|
-
return this.loading ? (
|
|
178
|
+
return this.loading ? ( localize(6769, "Loading...")) : ( localize(6770, "Load more"));
|
|
180
179
|
}
|
|
181
180
|
get themeIcon() {
|
|
182
181
|
return undefined;
|
|
@@ -185,7 +184,7 @@ class LoadMoreCommand {
|
|
|
185
184
|
const TimelineFollowActiveEditorContext = ( (new RawContextKey('timelineFollowActiveEditor', true, true)));
|
|
186
185
|
const TimelineExcludeSources = ( (new RawContextKey('timelineExcludeSources', '[]', true)));
|
|
187
186
|
let TimelinePane = class TimelinePane extends ViewPane {
|
|
188
|
-
static { this.TITLE = (
|
|
187
|
+
static { this.TITLE = ( localize2(6771, "Timeline")); }
|
|
189
188
|
constructor(options, keybindingService, contextMenuService, contextKeyService, configurationService, storageService, viewDescriptorService, instantiationService, editorService, commandService, progressService, timelineService, openerService, themeService, telemetryService, hoverService, labelService, uriIdentityService, extensionService) {
|
|
190
189
|
super({ ...options, titleMenuId: MenuId.TimelineTitle }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService);
|
|
191
190
|
this.storageService = storageService;
|
|
@@ -621,7 +620,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
621
620
|
this._isEmpty = !this.hasVisibleItems;
|
|
622
621
|
if (this.uri === undefined) {
|
|
623
622
|
this.updateFilename(undefined);
|
|
624
|
-
this.message = (
|
|
623
|
+
this.message = ( localize(6772, "The active editor cannot provide timeline information."));
|
|
625
624
|
}
|
|
626
625
|
else if (this._isEmpty) {
|
|
627
626
|
if (this.pendingRequests.size !== 0) {
|
|
@@ -631,25 +630,24 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
631
630
|
this.updateFilename(this.labelService.getUriBasenameLabel(this.uri));
|
|
632
631
|
const scmProviderCount = this.contextKeyService.getContextKeyValue('scm.providerCount');
|
|
633
632
|
if (this.timelineService.getSources().filter(({ id }) => !( (this.excludedSources.has(id)))).length === 0) {
|
|
634
|
-
this.message = (
|
|
633
|
+
this.message = ( localize(6773, "All timeline sources have been filtered out."));
|
|
635
634
|
}
|
|
636
635
|
else {
|
|
637
636
|
if (this.configurationService.getValue('workbench.localHistory.enabled') && !( (this.excludedSources.has('timeline.localHistory')))) {
|
|
638
|
-
this.message = (
|
|
639
|
-
|
|
640
|
-
5,
|
|
637
|
+
this.message = ( localize(
|
|
638
|
+
6774,
|
|
641
639
|
"Local History will track recent changes as you save them unless the file has been excluded or is too large."
|
|
642
640
|
));
|
|
643
641
|
}
|
|
644
642
|
else if (this.excludedSources.size > 0) {
|
|
645
|
-
this.message = (
|
|
643
|
+
this.message = ( localize(6775, "No filtered timeline information was provided."));
|
|
646
644
|
}
|
|
647
645
|
else {
|
|
648
|
-
this.message = (
|
|
646
|
+
this.message = ( localize(6776, "No timeline information was provided."));
|
|
649
647
|
}
|
|
650
648
|
}
|
|
651
649
|
if (!scmProviderCount || scmProviderCount === 0) {
|
|
652
|
-
this.message += ' ' + (
|
|
650
|
+
this.message += ' ' + ( localize(6777, "Source Control has not been configured."));
|
|
653
651
|
}
|
|
654
652
|
}
|
|
655
653
|
}
|
|
@@ -706,7 +704,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
706
704
|
container.classList.add('tree-explorer-viewlet-tree-view', 'timeline-tree-view');
|
|
707
705
|
this.$message = append(this.$container, $('.message'));
|
|
708
706
|
this.$message.classList.add('timeline-subtle');
|
|
709
|
-
this.message = (
|
|
707
|
+
this.message = ( localize(6777, "The active editor cannot provide timeline information."));
|
|
710
708
|
this.$tree = document.createElement('div');
|
|
711
709
|
this.$tree.classList.add('customview-tree', 'file-icon-themable-tree', 'hide-arrows');
|
|
712
710
|
container.appendChild(this.$tree);
|
|
@@ -723,13 +721,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
723
721
|
if (isLoadMoreCommand(element)) {
|
|
724
722
|
return element.ariaLabel;
|
|
725
723
|
}
|
|
726
|
-
return element.accessibilityInformation ? element.accessibilityInformation.label : (
|
|
727
|
-
_moduleId,
|
|
728
|
-
9,
|
|
729
|
-
"{0}: {1}",
|
|
730
|
-
element.relativeTimeFullWord ?? '',
|
|
731
|
-
element.label
|
|
732
|
-
));
|
|
724
|
+
return element.accessibilityInformation ? element.accessibilityInformation.label : ( localize(6778, "{0}: {1}", element.relativeTimeFullWord ?? '', element.label));
|
|
733
725
|
},
|
|
734
726
|
getRole(element) {
|
|
735
727
|
if (isLoadMoreCommand(element)) {
|
|
@@ -738,7 +730,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
738
730
|
return element.accessibilityInformation && element.accessibilityInformation.role ? element.accessibilityInformation.role : 'treeitem';
|
|
739
731
|
},
|
|
740
732
|
getWidgetAriaLabel() {
|
|
741
|
-
return (
|
|
733
|
+
return ( localize(6778, "Timeline"));
|
|
742
734
|
}
|
|
743
735
|
},
|
|
744
736
|
keyboardNavigationLabelProvider: ( (new TimelineKeyboardNavigationLabelProvider())),
|
|
@@ -799,7 +791,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
799
791
|
setLoadingUriMessage() {
|
|
800
792
|
const file = this.uri && this.labelService.getUriBasenameLabel(this.uri);
|
|
801
793
|
this.updateFilename(file);
|
|
802
|
-
this.message = file ? (
|
|
794
|
+
this.message = file ? ( localize(6779, "Loading timeline for {0}...", file)) : '';
|
|
803
795
|
}
|
|
804
796
|
onContextMenu(commands, treeEvent) {
|
|
805
797
|
const item = treeEvent.element;
|
|
@@ -987,9 +979,9 @@ TimelineTreeRenderer = ( (__decorate([
|
|
|
987
979
|
( (__param(1, IInstantiationService))),
|
|
988
980
|
( (__param(2, IThemeService)))
|
|
989
981
|
], TimelineTreeRenderer)));
|
|
990
|
-
const timelineRefresh = registerIcon('timeline-refresh', Codicon.refresh, (
|
|
991
|
-
const timelinePin = registerIcon('timeline-pin', Codicon.pin, (
|
|
992
|
-
const timelineUnpin = registerIcon('timeline-unpin', Codicon.pinned, (
|
|
982
|
+
const timelineRefresh = registerIcon('timeline-refresh', Codicon.refresh, ( localize(6780, 'Icon for the refresh timeline action.')));
|
|
983
|
+
const timelinePin = registerIcon('timeline-pin', Codicon.pin, ( localize(6781, 'Icon for the pin timeline action.')));
|
|
984
|
+
const timelineUnpin = registerIcon('timeline-unpin', Codicon.pinned, ( localize(6782, 'Icon for the unpin timeline action.')));
|
|
993
985
|
let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
994
986
|
constructor(pane, timelineService, storageService, contextKeyService, menuService) {
|
|
995
987
|
super();
|
|
@@ -1003,9 +995,9 @@ let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
|
1003
995
|
constructor() {
|
|
1004
996
|
super({
|
|
1005
997
|
id: 'timeline.refresh',
|
|
1006
|
-
title: (
|
|
998
|
+
title: ( localize2(6783, "Refresh")),
|
|
1007
999
|
icon: timelineRefresh,
|
|
1008
|
-
category: (
|
|
1000
|
+
category: ( localize2(6783, "Timeline")),
|
|
1009
1001
|
menu: {
|
|
1010
1002
|
id: MenuId.TimelineTitle,
|
|
1011
1003
|
group: 'navigation',
|
|
@@ -1021,9 +1013,9 @@ let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
|
1021
1013
|
this._register(MenuRegistry.appendMenuItem(MenuId.TimelineTitle, ({
|
|
1022
1014
|
command: {
|
|
1023
1015
|
id: 'timeline.toggleFollowActiveEditor',
|
|
1024
|
-
title: (
|
|
1016
|
+
title: ( localize2(6784, 'Pin the Current Timeline')),
|
|
1025
1017
|
icon: timelinePin,
|
|
1026
|
-
category: (
|
|
1018
|
+
category: ( localize2(6784, "Timeline")),
|
|
1027
1019
|
},
|
|
1028
1020
|
group: 'navigation',
|
|
1029
1021
|
order: 98,
|
|
@@ -1032,9 +1024,9 @@ let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
|
1032
1024
|
this._register(MenuRegistry.appendMenuItem(MenuId.TimelineTitle, ({
|
|
1033
1025
|
command: {
|
|
1034
1026
|
id: 'timeline.toggleFollowActiveEditor',
|
|
1035
|
-
title: (
|
|
1027
|
+
title: ( localize2(6785, 'Unpin the Current Timeline')),
|
|
1036
1028
|
icon: timelineUnpin,
|
|
1037
|
-
category: (
|
|
1029
|
+
category: ( localize2(6785, "Timeline")),
|
|
1038
1030
|
},
|
|
1039
1031
|
group: 'navigation',
|
|
1040
1032
|
order: 98,
|
|
@@ -1054,12 +1046,11 @@ let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
|
1054
1046
|
['view', this.pane.id],
|
|
1055
1047
|
[context.key, context.value],
|
|
1056
1048
|
]);
|
|
1057
|
-
const menu = this.menuService.
|
|
1049
|
+
const menu = this.menuService.getMenuActions(menuId, contextKeyService, { shouldForwardArgs: true });
|
|
1058
1050
|
const primary = [];
|
|
1059
1051
|
const secondary = [];
|
|
1060
1052
|
const result = { primary, secondary };
|
|
1061
|
-
createAndFillInContextMenuActions(menu,
|
|
1062
|
-
menu.dispose();
|
|
1053
|
+
createAndFillInContextMenuActions(menu, result, 'inline');
|
|
1063
1054
|
return result;
|
|
1064
1055
|
}
|
|
1065
1056
|
updateTimelineSourceFilters() {
|