@codingame/monaco-vscode-timeline-service-override 8.0.4 → 9.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 +2 -2
- package/vscode/src/vs/workbench/contrib/localHistory/browser/localHistoryCommands.js +89 -65
- package/vscode/src/vs/workbench/contrib/localHistory/browser/localHistoryTimeline.js +1 -1
- package/vscode/src/vs/workbench/contrib/timeline/browser/timeline.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/timeline/browser/timelinePane.js +22 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-timeline-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.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@9.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -23,7 +23,7 @@ function getLocalHistoryDateFormatter() {
|
|
|
23
23
|
}
|
|
24
24
|
const LOCAL_HISTORY_MENU_CONTEXT_VALUE = 'localHistory:item';
|
|
25
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, ( localize(
|
|
27
|
-
const LOCAL_HISTORY_ICON_RESTORE = registerIcon('localHistory-restore', Codicon.check, ( localize(
|
|
26
|
+
const LOCAL_HISTORY_ICON_ENTRY = registerIcon('localHistory-icon', Codicon.circleOutline, ( localize(10563, "Icon for a local history entry in the timeline view.")));
|
|
27
|
+
const LOCAL_HISTORY_ICON_RESTORE = registerIcon('localHistory-restore', Codicon.check, ( localize(10564, "Icon for restoring contents of a local history entry.")));
|
|
28
28
|
|
|
29
29
|
export { LOCAL_HISTORY_ICON_ENTRY, LOCAL_HISTORY_ICON_RESTORE, LOCAL_HISTORY_MENU_CONTEXT_KEY, LOCAL_HISTORY_MENU_CONTEXT_VALUE, getLocalHistoryDateFormatter };
|
|
@@ -23,13 +23,16 @@ import { getIconClasses } from 'vscode/vscode/vs/editor/common/services/getIconC
|
|
|
23
23
|
import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
|
|
24
24
|
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
25
25
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
26
|
-
import { firstOrDefault } from 'vscode/vscode/vs/base/common/arrays';
|
|
26
|
+
import { coalesce, 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
|
+
import { ResourceSet } from 'vscode/vscode/vs/base/common/map';
|
|
30
|
+
import { IHistoryService } from 'vscode/vscode/vs/workbench/services/history/common/history.service';
|
|
31
|
+
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
29
32
|
|
|
30
|
-
const LOCAL_HISTORY_CATEGORY = ( localize2(
|
|
33
|
+
const LOCAL_HISTORY_CATEGORY = ( localize2(6650, 'Local History'));
|
|
31
34
|
const CTX_LOCAL_HISTORY_ENABLED = ( (ContextKeyExpr.has('config.workbench.localHistory.enabled')));
|
|
32
|
-
const COMPARE_WITH_FILE_LABEL = ( localize2(
|
|
35
|
+
const COMPARE_WITH_FILE_LABEL = ( localize2(6651, 'Compare with File'));
|
|
33
36
|
registerAction2(class extends Action2 {
|
|
34
37
|
constructor() {
|
|
35
38
|
super({
|
|
@@ -56,7 +59,7 @@ registerAction2(class extends Action2 {
|
|
|
56
59
|
constructor() {
|
|
57
60
|
super({
|
|
58
61
|
id: 'workbench.action.localHistory.compareWithPrevious',
|
|
59
|
-
title: ( localize2(
|
|
62
|
+
title: ( localize2(6652, 'Compare with Previous')),
|
|
60
63
|
menu: {
|
|
61
64
|
id: MenuId.TimelineItemContext,
|
|
62
65
|
group: '1_compare',
|
|
@@ -84,7 +87,7 @@ registerAction2(class extends Action2 {
|
|
|
84
87
|
constructor() {
|
|
85
88
|
super({
|
|
86
89
|
id: 'workbench.action.localHistory.selectForCompare',
|
|
87
|
-
title: ( localize2(
|
|
90
|
+
title: ( localize2(6653, 'Select for Compare')),
|
|
88
91
|
menu: {
|
|
89
92
|
id: MenuId.TimelineItemContext,
|
|
90
93
|
group: '2_compare_with',
|
|
@@ -107,7 +110,7 @@ registerAction2(class extends Action2 {
|
|
|
107
110
|
constructor() {
|
|
108
111
|
super({
|
|
109
112
|
id: 'workbench.action.localHistory.compareWithSelected',
|
|
110
|
-
title: ( localize2(
|
|
113
|
+
title: ( localize2(6654, 'Compare with Selected')),
|
|
111
114
|
menu: {
|
|
112
115
|
id: MenuId.TimelineItemContext,
|
|
113
116
|
group: '2_compare_with',
|
|
@@ -136,7 +139,7 @@ registerAction2(class extends Action2 {
|
|
|
136
139
|
constructor() {
|
|
137
140
|
super({
|
|
138
141
|
id: 'workbench.action.localHistory.open',
|
|
139
|
-
title: ( localize2(
|
|
142
|
+
title: ( localize2(6655, 'Show Contents')),
|
|
140
143
|
menu: {
|
|
141
144
|
id: MenuId.TimelineItemContext,
|
|
142
145
|
group: '3_contents',
|
|
@@ -154,7 +157,7 @@ registerAction2(class extends Action2 {
|
|
|
154
157
|
}
|
|
155
158
|
}
|
|
156
159
|
});
|
|
157
|
-
const RESTORE_CONTENTS_LABEL = ( localize2(
|
|
160
|
+
const RESTORE_CONTENTS_LABEL = ( localize2(6656, 'Restore Contents'));
|
|
158
161
|
registerAction2(class extends Action2 {
|
|
159
162
|
constructor() {
|
|
160
163
|
super({
|
|
@@ -191,7 +194,7 @@ registerAction2(class extends Action2 {
|
|
|
191
194
|
return restore(accessor, item);
|
|
192
195
|
}
|
|
193
196
|
});
|
|
194
|
-
const restoreSaveSource = SaveSourceRegistry.registerSource('localHistoryRestore.source', ( localize(
|
|
197
|
+
const restoreSaveSource = SaveSourceRegistry.registerSource('localHistoryRestore.source', ( localize(6657, "File Restored")));
|
|
195
198
|
async function restore(accessor, item) {
|
|
196
199
|
const fileService = accessor.get(IFileService);
|
|
197
200
|
const dialogService = accessor.get(IDialogService);
|
|
@@ -203,12 +206,12 @@ async function restore(accessor, item) {
|
|
|
203
206
|
const { confirmed } = await dialogService.confirm({
|
|
204
207
|
type: 'warning',
|
|
205
208
|
message: ( localize(
|
|
206
|
-
|
|
209
|
+
6658,
|
|
207
210
|
"Do you want to restore the contents of '{0}'?",
|
|
208
211
|
basename(entry.workingCopy.resource)
|
|
209
212
|
)),
|
|
210
|
-
detail: ( localize(
|
|
211
|
-
primaryButton: ( localize(
|
|
213
|
+
detail: ( localize(6659, "Restoring will discard any unsaved changes.")),
|
|
214
|
+
primaryButton: ( localize(6660, "&&Restore"))
|
|
212
215
|
});
|
|
213
216
|
if (!confirmed) {
|
|
214
217
|
return;
|
|
@@ -225,7 +228,7 @@ async function restore(accessor, item) {
|
|
|
225
228
|
await fileService.cloneFile(entry.location, entry.workingCopy.resource);
|
|
226
229
|
}
|
|
227
230
|
catch (error) {
|
|
228
|
-
await dialogService.error(( localize(
|
|
231
|
+
await dialogService.error(( localize(6661, "Unable to restore '{0}'.", basename(entry.workingCopy.resource))), toErrorMessage(error));
|
|
229
232
|
return;
|
|
230
233
|
}
|
|
231
234
|
if (workingCopies) {
|
|
@@ -245,7 +248,7 @@ registerAction2(class extends Action2 {
|
|
|
245
248
|
constructor() {
|
|
246
249
|
super({
|
|
247
250
|
id: 'workbench.action.localHistory.restoreViaPicker',
|
|
248
|
-
title: ( localize2(
|
|
251
|
+
title: ( localize2(6662, 'Find Entry to Restore')),
|
|
249
252
|
f1: true,
|
|
250
253
|
category: LOCAL_HISTORY_CATEGORY,
|
|
251
254
|
precondition: CTX_LOCAL_HISTORY_ENABLED
|
|
@@ -260,36 +263,51 @@ registerAction2(class extends Action2 {
|
|
|
260
263
|
const editorService = accessor.get(IEditorService);
|
|
261
264
|
const fileService = accessor.get(IFileService);
|
|
262
265
|
const commandService = accessor.get(ICommandService);
|
|
263
|
-
const
|
|
266
|
+
const historyService = accessor.get(IHistoryService);
|
|
267
|
+
const resourcePickerDisposables = ( (new DisposableStore()));
|
|
268
|
+
const resourcePicker = resourcePickerDisposables.add(quickInputService.createQuickPick());
|
|
264
269
|
let cts = ( (new CancellationTokenSource()));
|
|
265
|
-
resourcePicker.onDidHide(() => cts.dispose(true));
|
|
270
|
+
resourcePickerDisposables.add(resourcePicker.onDidHide(() => cts.dispose(true)));
|
|
266
271
|
resourcePicker.busy = true;
|
|
267
272
|
resourcePicker.show();
|
|
268
|
-
const resources = await workingCopyHistoryService.getAll(cts.token);
|
|
273
|
+
const resources = ( (new ResourceSet(await workingCopyHistoryService.getAll(cts.token))));
|
|
274
|
+
const recentEditorResources = ( (new ResourceSet(
|
|
275
|
+
coalesce(( (historyService.getHistory().map(({ resource }) => resource))))
|
|
276
|
+
)));
|
|
277
|
+
const resourcesSortedByRecency = [];
|
|
278
|
+
for (const resource of recentEditorResources) {
|
|
279
|
+
if (( (resources.has(resource)))) {
|
|
280
|
+
resourcesSortedByRecency.push(resource);
|
|
281
|
+
resources.delete(resource);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
resourcesSortedByRecency.push(...[...resources].sort((r1, r2) => r1.fsPath < r2.fsPath ? -1 : 1));
|
|
269
285
|
resourcePicker.busy = false;
|
|
270
|
-
resourcePicker.placeholder = ( localize(
|
|
286
|
+
resourcePicker.placeholder = ( localize(6663, "Select the file to show local history for"));
|
|
271
287
|
resourcePicker.matchOnLabel = true;
|
|
272
288
|
resourcePicker.matchOnDescription = true;
|
|
273
|
-
resourcePicker.items = ( (
|
|
289
|
+
resourcePicker.items = ( ([...resourcesSortedByRecency].map(resource => ({
|
|
274
290
|
resource,
|
|
275
291
|
label: basenameOrAuthority(resource),
|
|
276
292
|
description: labelService.getUriLabel(dirname(resource), { relative: true }),
|
|
277
293
|
iconClasses: getIconClasses(modelService, languageService, resource)
|
|
278
|
-
}))))
|
|
294
|
+
}))));
|
|
279
295
|
await Event.toPromise(resourcePicker.onDidAccept);
|
|
280
|
-
|
|
296
|
+
resourcePickerDisposables.dispose();
|
|
281
297
|
const resource = firstOrDefault(resourcePicker.selectedItems)?.resource;
|
|
282
298
|
if (!resource) {
|
|
283
299
|
return;
|
|
284
300
|
}
|
|
285
|
-
const
|
|
301
|
+
const entryPickerDisposables = ( (new DisposableStore()));
|
|
302
|
+
const entryPicker = entryPickerDisposables.add(quickInputService.createQuickPick());
|
|
286
303
|
cts = ( (new CancellationTokenSource()));
|
|
287
|
-
entryPicker.onDidHide(() => cts.dispose(true));
|
|
304
|
+
entryPickerDisposables.add(entryPicker.onDidHide(() => cts.dispose(true)));
|
|
288
305
|
entryPicker.busy = true;
|
|
289
306
|
entryPicker.show();
|
|
290
307
|
const entries = await workingCopyHistoryService.getEntries(resource, cts.token);
|
|
291
308
|
entryPicker.busy = false;
|
|
292
|
-
entryPicker.
|
|
309
|
+
entryPicker.canAcceptInBackground = true;
|
|
310
|
+
entryPicker.placeholder = ( localize(6664, "Select the local history entry to open"));
|
|
293
311
|
entryPicker.matchOnLabel = true;
|
|
294
312
|
entryPicker.matchOnDescription = true;
|
|
295
313
|
entryPicker.items = ( (Array.from(entries).reverse().map(entry => ({
|
|
@@ -297,25 +315,28 @@ registerAction2(class extends Action2 {
|
|
|
297
315
|
label: `$(circle-outline) ${SaveSourceRegistry.getSourceLabel(entry.source)}`,
|
|
298
316
|
description: toLocalHistoryEntryDateLabel(entry.timestamp)
|
|
299
317
|
}))));
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
318
|
+
entryPickerDisposables.add(entryPicker.onDidAccept(async (e) => {
|
|
319
|
+
if (!e.inBackground) {
|
|
320
|
+
entryPickerDisposables.dispose();
|
|
321
|
+
}
|
|
322
|
+
const selectedItem = firstOrDefault(entryPicker.selectedItems);
|
|
323
|
+
if (!selectedItem) {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
const resourceExists = await fileService.exists(selectedItem.entry.workingCopy.resource);
|
|
327
|
+
if (resourceExists) {
|
|
328
|
+
return commandService.executeCommand(API_OPEN_DIFF_EDITOR_COMMAND_ID, ...toDiffEditorArguments(selectedItem.entry, selectedItem.entry.workingCopy.resource, { preserveFocus: e.inBackground }));
|
|
329
|
+
}
|
|
330
|
+
return openEntry(selectedItem.entry, editorService, { preserveFocus: e.inBackground });
|
|
331
|
+
}));
|
|
311
332
|
}
|
|
312
333
|
});
|
|
313
|
-
MenuRegistry.appendMenuItem(MenuId.TimelineTitle, { command: { id: 'workbench.action.localHistory.restoreViaPicker', title: ( localize2(
|
|
334
|
+
MenuRegistry.appendMenuItem(MenuId.TimelineTitle, { command: { id: 'workbench.action.localHistory.restoreViaPicker', title: ( localize2(6665, 'Local History: Find Entry to Restore...')) }, group: 'submenu', order: 1, when: CTX_LOCAL_HISTORY_ENABLED });
|
|
314
335
|
registerAction2(class extends Action2 {
|
|
315
336
|
constructor() {
|
|
316
337
|
super({
|
|
317
338
|
id: 'workbench.action.localHistory.rename',
|
|
318
|
-
title: ( localize2(
|
|
339
|
+
title: ( localize2(6666, 'Rename')),
|
|
319
340
|
menu: {
|
|
320
341
|
id: MenuId.TimelineItemContext,
|
|
321
342
|
group: '5_edit',
|
|
@@ -329,18 +350,19 @@ registerAction2(class extends Action2 {
|
|
|
329
350
|
const quickInputService = accessor.get(IQuickInputService);
|
|
330
351
|
const { entry } = await findLocalHistoryEntry(workingCopyHistoryService, item);
|
|
331
352
|
if (entry) {
|
|
332
|
-
const
|
|
333
|
-
inputBox
|
|
353
|
+
const disposables = ( (new DisposableStore()));
|
|
354
|
+
const inputBox = disposables.add(quickInputService.createInputBox());
|
|
355
|
+
inputBox.title = ( localize(6667, "Rename Local History Entry"));
|
|
334
356
|
inputBox.ignoreFocusOut = true;
|
|
335
|
-
inputBox.placeholder = ( localize(
|
|
357
|
+
inputBox.placeholder = ( localize(6668, "Enter the new name of the local history entry"));
|
|
336
358
|
inputBox.value = SaveSourceRegistry.getSourceLabel(entry.source);
|
|
337
359
|
inputBox.show();
|
|
338
|
-
inputBox.onDidAccept(() => {
|
|
360
|
+
disposables.add(inputBox.onDidAccept(() => {
|
|
339
361
|
if (inputBox.value) {
|
|
340
362
|
workingCopyHistoryService.updateEntry(entry, { source: inputBox.value }, CancellationToken.None);
|
|
341
363
|
}
|
|
342
|
-
|
|
343
|
-
});
|
|
364
|
+
disposables.dispose();
|
|
365
|
+
}));
|
|
344
366
|
}
|
|
345
367
|
}
|
|
346
368
|
});
|
|
@@ -348,7 +370,7 @@ registerAction2(class extends Action2 {
|
|
|
348
370
|
constructor() {
|
|
349
371
|
super({
|
|
350
372
|
id: 'workbench.action.localHistory.delete',
|
|
351
|
-
title: ( localize2(
|
|
373
|
+
title: ( localize2(6669, 'Delete')),
|
|
352
374
|
menu: {
|
|
353
375
|
id: MenuId.TimelineItemContext,
|
|
354
376
|
group: '5_edit',
|
|
@@ -366,13 +388,13 @@ registerAction2(class extends Action2 {
|
|
|
366
388
|
const { confirmed } = await dialogService.confirm({
|
|
367
389
|
type: 'warning',
|
|
368
390
|
message: ( localize(
|
|
369
|
-
|
|
391
|
+
6670,
|
|
370
392
|
"Do you want to delete the local history entry of '{0}' from {1}?",
|
|
371
393
|
entry.workingCopy.name,
|
|
372
394
|
toLocalHistoryEntryDateLabel(entry.timestamp)
|
|
373
395
|
)),
|
|
374
|
-
detail: ( localize(
|
|
375
|
-
primaryButton: ( localize(
|
|
396
|
+
detail: ( localize(6671, "This action is irreversible!")),
|
|
397
|
+
primaryButton: ( localize(6672, "&&Delete")),
|
|
376
398
|
});
|
|
377
399
|
if (!confirmed) {
|
|
378
400
|
return;
|
|
@@ -386,7 +408,7 @@ registerAction2(class extends Action2 {
|
|
|
386
408
|
constructor() {
|
|
387
409
|
super({
|
|
388
410
|
id: 'workbench.action.localHistory.deleteAll',
|
|
389
|
-
title: ( localize2(
|
|
411
|
+
title: ( localize2(6673, 'Delete All')),
|
|
390
412
|
f1: true,
|
|
391
413
|
category: LOCAL_HISTORY_CATEGORY,
|
|
392
414
|
precondition: CTX_LOCAL_HISTORY_ENABLED
|
|
@@ -397,9 +419,9 @@ registerAction2(class extends Action2 {
|
|
|
397
419
|
const workingCopyHistoryService = accessor.get(IWorkingCopyHistoryService);
|
|
398
420
|
const { confirmed } = await dialogService.confirm({
|
|
399
421
|
type: 'warning',
|
|
400
|
-
message: ( localize(
|
|
401
|
-
detail: ( localize(
|
|
402
|
-
primaryButton: ( localize(
|
|
422
|
+
message: ( localize(6674, "Do you want to delete all entries of all files in local history?")),
|
|
423
|
+
detail: ( localize(6675, "This action is irreversible!")),
|
|
424
|
+
primaryButton: ( localize(6676, "&&Delete All")),
|
|
403
425
|
});
|
|
404
426
|
if (!confirmed) {
|
|
405
427
|
return;
|
|
@@ -411,7 +433,7 @@ registerAction2(class extends Action2 {
|
|
|
411
433
|
constructor() {
|
|
412
434
|
super({
|
|
413
435
|
id: 'workbench.action.localHistory.create',
|
|
414
|
-
title: ( localize2(
|
|
436
|
+
title: ( localize2(6677, 'Create Entry')),
|
|
415
437
|
f1: true,
|
|
416
438
|
category: LOCAL_HISTORY_CATEGORY,
|
|
417
439
|
precondition: ( (ContextKeyExpr.and(CTX_LOCAL_HISTORY_ENABLED, ActiveEditorContext)))
|
|
@@ -427,35 +449,37 @@ registerAction2(class extends Action2 {
|
|
|
427
449
|
if (resource?.scheme !== pathService.defaultUriScheme && resource?.scheme !== Schemas.vscodeUserData) {
|
|
428
450
|
return;
|
|
429
451
|
}
|
|
430
|
-
const
|
|
431
|
-
inputBox
|
|
452
|
+
const disposables = ( (new DisposableStore()));
|
|
453
|
+
const inputBox = disposables.add(quickInputService.createInputBox());
|
|
454
|
+
inputBox.title = ( localize(6678, "Create Local History Entry"));
|
|
432
455
|
inputBox.ignoreFocusOut = true;
|
|
433
456
|
inputBox.placeholder = ( localize(
|
|
434
|
-
|
|
457
|
+
6679,
|
|
435
458
|
"Enter the new name of the local history entry for '{0}'",
|
|
436
459
|
labelService.getUriBasenameLabel(resource)
|
|
437
460
|
));
|
|
438
461
|
inputBox.show();
|
|
439
|
-
inputBox.onDidAccept(async () => {
|
|
462
|
+
disposables.add(inputBox.onDidAccept(async () => {
|
|
440
463
|
const entrySource = inputBox.value;
|
|
441
|
-
|
|
464
|
+
disposables.dispose();
|
|
442
465
|
if (entrySource) {
|
|
443
466
|
await workingCopyHistoryService.addEntry({ resource, source: inputBox.value }, CancellationToken.None);
|
|
444
467
|
}
|
|
445
|
-
});
|
|
468
|
+
}));
|
|
446
469
|
}
|
|
447
470
|
});
|
|
448
|
-
async function openEntry(entry, editorService) {
|
|
471
|
+
async function openEntry(entry, editorService, options) {
|
|
449
472
|
const resource = LocalHistoryFileSystemProvider.toLocalHistoryFileSystem({ location: entry.location, associatedResource: entry.workingCopy.resource });
|
|
450
473
|
await editorService.openEditor({
|
|
451
474
|
resource,
|
|
452
475
|
label: ( localize(
|
|
453
|
-
|
|
476
|
+
6680,
|
|
454
477
|
"{0} ({1} • {2})",
|
|
455
478
|
entry.workingCopy.name,
|
|
456
479
|
SaveSourceRegistry.getSourceLabel(entry.source),
|
|
457
480
|
toLocalHistoryEntryDateLabel(entry.timestamp)
|
|
458
|
-
))
|
|
481
|
+
)),
|
|
482
|
+
options
|
|
459
483
|
});
|
|
460
484
|
}
|
|
461
485
|
async function closeEntry(entry, editorService) {
|
|
@@ -463,7 +487,7 @@ async function closeEntry(entry, editorService) {
|
|
|
463
487
|
const editors = editorService.findEditors(resource, { supportSideBySide: SideBySideEditor.ANY });
|
|
464
488
|
await editorService.closeEditors(editors, { preserveFocus: true });
|
|
465
489
|
}
|
|
466
|
-
function toDiffEditorArguments(arg1, arg2) {
|
|
490
|
+
function toDiffEditorArguments(arg1, arg2, options) {
|
|
467
491
|
const originalResource = LocalHistoryFileSystemProvider.toLocalHistoryFileSystem({ location: arg1.location, associatedResource: arg1.workingCopy.resource });
|
|
468
492
|
let label;
|
|
469
493
|
let modifiedResource;
|
|
@@ -471,7 +495,7 @@ function toDiffEditorArguments(arg1, arg2) {
|
|
|
471
495
|
const resource = arg2;
|
|
472
496
|
modifiedResource = resource;
|
|
473
497
|
label = ( localize(
|
|
474
|
-
|
|
498
|
+
6681,
|
|
475
499
|
"{0} ({1} • {2}) ↔ {3}",
|
|
476
500
|
arg1.workingCopy.name,
|
|
477
501
|
SaveSourceRegistry.getSourceLabel(arg1.source),
|
|
@@ -483,7 +507,7 @@ function toDiffEditorArguments(arg1, arg2) {
|
|
|
483
507
|
const modified = arg2;
|
|
484
508
|
modifiedResource = LocalHistoryFileSystemProvider.toLocalHistoryFileSystem({ location: modified.location, associatedResource: modified.workingCopy.resource });
|
|
485
509
|
label = ( localize(
|
|
486
|
-
|
|
510
|
+
6682,
|
|
487
511
|
"{0} ({1} • {2}) ↔ {3} ({4} • {5})",
|
|
488
512
|
arg1.workingCopy.name,
|
|
489
513
|
SaveSourceRegistry.getSourceLabel(arg1.source),
|
|
@@ -497,7 +521,7 @@ function toDiffEditorArguments(arg1, arg2) {
|
|
|
497
521
|
originalResource,
|
|
498
522
|
modifiedResource,
|
|
499
523
|
label,
|
|
500
|
-
undefined
|
|
524
|
+
options ? [undefined, options] : undefined
|
|
501
525
|
];
|
|
502
526
|
}
|
|
503
527
|
async function findLocalHistoryEntry(workingCopyHistoryService, descriptor) {
|
|
@@ -34,7 +34,7 @@ let LocalHistoryTimeline = class LocalHistoryTimeline extends Disposable {
|
|
|
34
34
|
this.configurationService = configurationService;
|
|
35
35
|
this.contextService = contextService;
|
|
36
36
|
this.id = 'timeline.localHistory';
|
|
37
|
-
this.label = ( localize(
|
|
37
|
+
this.label = ( localize(6683, "Local History"));
|
|
38
38
|
this.scheme = '*';
|
|
39
39
|
this._onDidChange = this._register(( (new Emitter())));
|
|
40
40
|
this.onDidChange = this._onDidChange.event;
|
|
@@ -17,8 +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 timelineViewIcon = registerIcon('timeline-view-icon', Codicon.history, ( localize(
|
|
21
|
-
const timelineOpenIcon = registerIcon('timeline-open', Codicon.history, ( localize(
|
|
20
|
+
const timelineViewIcon = registerIcon('timeline-view-icon', Codicon.history, ( localize(2503, 'View icon of the timeline view.')));
|
|
21
|
+
const timelineOpenIcon = registerIcon('timeline-open', Codicon.history, ( localize(2504, 'Icon for the open timeline action.')));
|
|
22
22
|
class TimelinePaneDescriptor {
|
|
23
23
|
constructor() {
|
|
24
24
|
this.id = TimelinePaneId;
|
|
@@ -39,14 +39,14 @@ const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
|
|
|
39
39
|
configurationRegistry.registerConfiguration({
|
|
40
40
|
id: 'timeline',
|
|
41
41
|
order: 1001,
|
|
42
|
-
title: ( localize(
|
|
42
|
+
title: ( localize(2505, "Timeline")),
|
|
43
43
|
type: 'object',
|
|
44
44
|
properties: {
|
|
45
45
|
'timeline.pageSize': {
|
|
46
46
|
type: ['number', 'null'],
|
|
47
47
|
default: null,
|
|
48
48
|
markdownDescription: ( localize(
|
|
49
|
-
|
|
49
|
+
2506,
|
|
50
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."
|
|
51
51
|
)),
|
|
52
52
|
},
|
|
@@ -54,7 +54,7 @@ configurationRegistry.registerConfiguration({
|
|
|
54
54
|
type: 'boolean',
|
|
55
55
|
default: false,
|
|
56
56
|
description: ( localize(
|
|
57
|
-
|
|
57
|
+
2507,
|
|
58
58
|
"Experimental. Controls whether the Timeline view will load the next page of items when you scroll to the end of the list."
|
|
59
59
|
)),
|
|
60
60
|
},
|
|
@@ -64,7 +64,7 @@ configurationRegistry.registerConfiguration({
|
|
|
64
64
|
var OpenTimelineAction;
|
|
65
65
|
( ((function(OpenTimelineAction) {
|
|
66
66
|
OpenTimelineAction.ID = 'files.openTimeline';
|
|
67
|
-
OpenTimelineAction.LABEL = ( localize(
|
|
67
|
+
OpenTimelineAction.LABEL = ( localize(2508, "Open Timeline"));
|
|
68
68
|
function handler() {
|
|
69
69
|
return (accessor, arg) => {
|
|
70
70
|
const service = accessor.get(ITimelineService);
|
|
@@ -88,10 +88,10 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, ({
|
|
|
88
88
|
TimelineHasProviderContext
|
|
89
89
|
)))
|
|
90
90
|
}));
|
|
91
|
-
const timelineFilter = registerIcon('timeline-filter', Codicon.filter, ( localize(
|
|
91
|
+
const timelineFilter = registerIcon('timeline-filter', Codicon.filter, ( localize(2509, 'Icon for the filter timeline action.')));
|
|
92
92
|
MenuRegistry.appendMenuItem(MenuId.TimelineTitle, {
|
|
93
93
|
submenu: MenuId.TimelineFilterSubMenu,
|
|
94
|
-
title: ( localize(
|
|
94
|
+
title: ( localize(2510, "Filter Timeline")),
|
|
95
95
|
group: 'navigation',
|
|
96
96
|
order: 100,
|
|
97
97
|
icon: timelineFilter
|
|
@@ -58,7 +58,7 @@ function isLoadMoreCommand(item) {
|
|
|
58
58
|
return item instanceof LoadMoreCommand;
|
|
59
59
|
}
|
|
60
60
|
function isTimelineItem(item) {
|
|
61
|
-
return !item
|
|
61
|
+
return !!item && !item.handle.startsWith('vscode-command:');
|
|
62
62
|
}
|
|
63
63
|
function updateRelativeTime(item, lastRelativeTime) {
|
|
64
64
|
item.relativeTime = isTimelineItem(item) ? fromNow(item.timestamp) : undefined;
|
|
@@ -175,7 +175,7 @@ class LoadMoreCommand {
|
|
|
175
175
|
return this.label;
|
|
176
176
|
}
|
|
177
177
|
get label() {
|
|
178
|
-
return this.loading ? ( localize(
|
|
178
|
+
return this.loading ? ( localize(6633, "Loading...")) : ( localize(6634, "Load more"));
|
|
179
179
|
}
|
|
180
180
|
get themeIcon() {
|
|
181
181
|
return undefined;
|
|
@@ -184,7 +184,7 @@ class LoadMoreCommand {
|
|
|
184
184
|
const TimelineFollowActiveEditorContext = ( (new RawContextKey('timelineFollowActiveEditor', true, true)));
|
|
185
185
|
const TimelineExcludeSources = ( (new RawContextKey('timelineExcludeSources', '[]', true)));
|
|
186
186
|
let TimelinePane = class TimelinePane extends ViewPane {
|
|
187
|
-
static { this.TITLE = ( localize2(
|
|
187
|
+
static { this.TITLE = ( localize2(6635, "Timeline")); }
|
|
188
188
|
constructor(options, keybindingService, contextMenuService, contextKeyService, configurationService, storageService, viewDescriptorService, instantiationService, editorService, commandService, progressService, timelineService, openerService, themeService, telemetryService, hoverService, labelService, uriIdentityService, extensionService) {
|
|
189
189
|
super({ ...options, titleMenuId: MenuId.TimelineTitle }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService);
|
|
190
190
|
this.storageService = storageService;
|
|
@@ -620,7 +620,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
620
620
|
this._isEmpty = !this.hasVisibleItems;
|
|
621
621
|
if (this.uri === undefined) {
|
|
622
622
|
this.updateFilename(undefined);
|
|
623
|
-
this.message = ( localize(
|
|
623
|
+
this.message = ( localize(6636, "The active editor cannot provide timeline information."));
|
|
624
624
|
}
|
|
625
625
|
else if (this._isEmpty) {
|
|
626
626
|
if (this.pendingRequests.size !== 0) {
|
|
@@ -630,24 +630,24 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
630
630
|
this.updateFilename(this.labelService.getUriBasenameLabel(this.uri));
|
|
631
631
|
const scmProviderCount = this.contextKeyService.getContextKeyValue('scm.providerCount');
|
|
632
632
|
if (this.timelineService.getSources().filter(({ id }) => !( (this.excludedSources.has(id)))).length === 0) {
|
|
633
|
-
this.message = ( localize(
|
|
633
|
+
this.message = ( localize(6637, "All timeline sources have been filtered out."));
|
|
634
634
|
}
|
|
635
635
|
else {
|
|
636
636
|
if (this.configurationService.getValue('workbench.localHistory.enabled') && !( (this.excludedSources.has('timeline.localHistory')))) {
|
|
637
637
|
this.message = ( localize(
|
|
638
|
-
|
|
638
|
+
6638,
|
|
639
639
|
"Local History will track recent changes as you save them unless the file has been excluded or is too large."
|
|
640
640
|
));
|
|
641
641
|
}
|
|
642
642
|
else if (this.excludedSources.size > 0) {
|
|
643
|
-
this.message = ( localize(
|
|
643
|
+
this.message = ( localize(6639, "No filtered timeline information was provided."));
|
|
644
644
|
}
|
|
645
645
|
else {
|
|
646
|
-
this.message = ( localize(
|
|
646
|
+
this.message = ( localize(6640, "No timeline information was provided."));
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
649
|
if (!scmProviderCount || scmProviderCount === 0) {
|
|
650
|
-
this.message += ' ' + ( localize(
|
|
650
|
+
this.message += ' ' + ( localize(6641, "Source Control has not been configured."));
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
}
|
|
@@ -704,7 +704,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
704
704
|
container.classList.add('tree-explorer-viewlet-tree-view', 'timeline-tree-view');
|
|
705
705
|
this.$message = append(this.$container, $('.message'));
|
|
706
706
|
this.$message.classList.add('timeline-subtle');
|
|
707
|
-
this.message = ( localize(
|
|
707
|
+
this.message = ( localize(6636, "The active editor cannot provide timeline information."));
|
|
708
708
|
this.$tree = document.createElement('div');
|
|
709
709
|
this.$tree.classList.add('customview-tree', 'file-icon-themable-tree', 'hide-arrows');
|
|
710
710
|
container.appendChild(this.$tree);
|
|
@@ -721,7 +721,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
721
721
|
if (isLoadMoreCommand(element)) {
|
|
722
722
|
return element.ariaLabel;
|
|
723
723
|
}
|
|
724
|
-
return element.accessibilityInformation ? element.accessibilityInformation.label : ( localize(
|
|
724
|
+
return element.accessibilityInformation ? element.accessibilityInformation.label : ( localize(6642, "{0}: {1}", element.relativeTimeFullWord ?? '', element.label));
|
|
725
725
|
},
|
|
726
726
|
getRole(element) {
|
|
727
727
|
if (isLoadMoreCommand(element)) {
|
|
@@ -730,7 +730,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
730
730
|
return element.accessibilityInformation && element.accessibilityInformation.role ? element.accessibilityInformation.role : 'treeitem';
|
|
731
731
|
},
|
|
732
732
|
getWidgetAriaLabel() {
|
|
733
|
-
return ( localize(
|
|
733
|
+
return ( localize(6635, "Timeline"));
|
|
734
734
|
}
|
|
735
735
|
},
|
|
736
736
|
keyboardNavigationLabelProvider: ( (new TimelineKeyboardNavigationLabelProvider())),
|
|
@@ -791,7 +791,7 @@ let TimelinePane = class TimelinePane extends ViewPane {
|
|
|
791
791
|
setLoadingUriMessage() {
|
|
792
792
|
const file = this.uri && this.labelService.getUriBasenameLabel(this.uri);
|
|
793
793
|
this.updateFilename(file);
|
|
794
|
-
this.message = file ? ( localize(
|
|
794
|
+
this.message = file ? ( localize(6643, "Loading timeline for {0}...", file)) : '';
|
|
795
795
|
}
|
|
796
796
|
onContextMenu(commands, treeEvent) {
|
|
797
797
|
const item = treeEvent.element;
|
|
@@ -979,9 +979,9 @@ TimelineTreeRenderer = ( (__decorate([
|
|
|
979
979
|
( (__param(1, IInstantiationService))),
|
|
980
980
|
( (__param(2, IThemeService)))
|
|
981
981
|
], TimelineTreeRenderer)));
|
|
982
|
-
const timelineRefresh = registerIcon('timeline-refresh', Codicon.refresh, ( localize(
|
|
983
|
-
const timelinePin = registerIcon('timeline-pin', Codicon.pin, ( localize(
|
|
984
|
-
const timelineUnpin = registerIcon('timeline-unpin', Codicon.pinned, ( localize(
|
|
982
|
+
const timelineRefresh = registerIcon('timeline-refresh', Codicon.refresh, ( localize(6644, 'Icon for the refresh timeline action.')));
|
|
983
|
+
const timelinePin = registerIcon('timeline-pin', Codicon.pin, ( localize(6645, 'Icon for the pin timeline action.')));
|
|
984
|
+
const timelineUnpin = registerIcon('timeline-unpin', Codicon.pinned, ( localize(6646, 'Icon for the unpin timeline action.')));
|
|
985
985
|
let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
986
986
|
constructor(pane, timelineService, storageService, contextKeyService, menuService) {
|
|
987
987
|
super();
|
|
@@ -995,9 +995,9 @@ let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
|
995
995
|
constructor() {
|
|
996
996
|
super({
|
|
997
997
|
id: 'timeline.refresh',
|
|
998
|
-
title: ( localize2(
|
|
998
|
+
title: ( localize2(6647, "Refresh")),
|
|
999
999
|
icon: timelineRefresh,
|
|
1000
|
-
category: ( localize2(
|
|
1000
|
+
category: ( localize2(6635, "Timeline")),
|
|
1001
1001
|
menu: {
|
|
1002
1002
|
id: MenuId.TimelineTitle,
|
|
1003
1003
|
group: 'navigation',
|
|
@@ -1013,9 +1013,9 @@ let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
|
1013
1013
|
this._register(MenuRegistry.appendMenuItem(MenuId.TimelineTitle, ({
|
|
1014
1014
|
command: {
|
|
1015
1015
|
id: 'timeline.toggleFollowActiveEditor',
|
|
1016
|
-
title: ( localize2(
|
|
1016
|
+
title: ( localize2(6648, 'Pin the Current Timeline')),
|
|
1017
1017
|
icon: timelinePin,
|
|
1018
|
-
category: ( localize2(
|
|
1018
|
+
category: ( localize2(6635, "Timeline")),
|
|
1019
1019
|
},
|
|
1020
1020
|
group: 'navigation',
|
|
1021
1021
|
order: 98,
|
|
@@ -1024,9 +1024,9 @@ let TimelinePaneCommands = class TimelinePaneCommands extends Disposable {
|
|
|
1024
1024
|
this._register(MenuRegistry.appendMenuItem(MenuId.TimelineTitle, ({
|
|
1025
1025
|
command: {
|
|
1026
1026
|
id: 'timeline.toggleFollowActiveEditor',
|
|
1027
|
-
title: ( localize2(
|
|
1027
|
+
title: ( localize2(6649, 'Unpin the Current Timeline')),
|
|
1028
1028
|
icon: timelineUnpin,
|
|
1029
|
-
category: ( localize2(
|
|
1029
|
+
category: ( localize2(6635, "Timeline")),
|
|
1030
1030
|
},
|
|
1031
1031
|
group: 'navigation',
|
|
1032
1032
|
order: 98,
|