@codingame/monaco-vscode-scm-service-override 5.2.0 → 6.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/scm/browser/activity.js +41 -24
- package/vscode/src/vs/workbench/contrib/scm/browser/menus.js +1 -1
- package/vscode/src/vs/workbench/contrib/scm/browser/scm.contribution.js +74 -24
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoriesViewPane.js +3 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPane.js +249 -202
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewService.js +11 -12
- package/vscode/src/vs/workbench/contrib/scm/browser/workingSet.js +12 -6
- package/vscode/src/vs/workbench/contrib/scm/common/scmService.js +10 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-scm-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.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@6.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -2,13 +2,14 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { basename } from 'vscode/vscode/vs/base/common/resources';
|
|
4
4
|
import { Disposable, MutableDisposable, DisposableStore, combinedDisposable, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
5
|
+
import { Event, Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
6
6
|
import { VIEW_PANE_ID } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm';
|
|
7
7
|
import { ISCMService, ISCMViewService } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm.service';
|
|
8
8
|
import { NumberBadge } from 'vscode/vscode/vs/workbench/services/activity/common/activity';
|
|
9
9
|
import { IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity.service';
|
|
10
10
|
import { RawContextKey } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
11
11
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
12
|
+
import { StatusbarAlignment } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
|
|
12
13
|
import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
13
14
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
14
15
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
@@ -17,6 +18,7 @@ import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/commo
|
|
|
17
18
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
18
19
|
import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
|
|
19
20
|
import { ITitleService } from 'vscode/vscode/vs/workbench/services/title/browser/titleService.service';
|
|
21
|
+
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
20
22
|
|
|
21
23
|
const _moduleId = "vs/workbench/contrib/scm/browser/activity";
|
|
22
24
|
function getCount(repository) {
|
|
@@ -142,8 +144,8 @@ let SCMStatusController = class SCMStatusController {
|
|
|
142
144
|
command: command.id ? command : undefined
|
|
143
145
|
};
|
|
144
146
|
disposables.add(index === 0 ?
|
|
145
|
-
this.statusbarService.addEntry(statusbarEntry, `status.scm.${index}`,
|
|
146
|
-
this.statusbarService.addEntry(statusbarEntry, `status.scm.${index}`,
|
|
147
|
+
this.statusbarService.addEntry(statusbarEntry, `status.scm.${index}`, StatusbarAlignment.LEFT, 10000) :
|
|
148
|
+
this.statusbarService.addEntry(statusbarEntry, `status.scm.${index}`, StatusbarAlignment.LEFT, { id: `status.scm.${index - 1}`, alignment: StatusbarAlignment.RIGHT, compact: true }));
|
|
147
149
|
}
|
|
148
150
|
this.statusBarDisposable = disposables;
|
|
149
151
|
}
|
|
@@ -240,64 +242,79 @@ SCMActiveRepositoryContextKeyController = ( (__decorate([
|
|
|
240
242
|
( (__param(4, IUriIdentityService)))
|
|
241
243
|
], SCMActiveRepositoryContextKeyController)));
|
|
242
244
|
let SCMActiveResourceContextKeyController = class SCMActiveResourceContextKeyController {
|
|
243
|
-
constructor(
|
|
244
|
-
this.editorService = editorService;
|
|
245
|
+
constructor(editorGroupsService, scmService, uriIdentityService) {
|
|
245
246
|
this.scmService = scmService;
|
|
246
247
|
this.uriIdentityService = uriIdentityService;
|
|
247
248
|
this.disposables = ( (new DisposableStore()));
|
|
248
249
|
this.repositoryDisposables = ( (new Set()));
|
|
249
|
-
this.
|
|
250
|
-
|
|
250
|
+
this.onDidRepositoryChange = ( (new Emitter()));
|
|
251
|
+
const activeResourceHasChangesContextKey = ( (new RawContextKey('scmActiveResourceHasChanges', false, ( localizeWithPath(_moduleId, 2, "Whether the active resource has changes")))));
|
|
252
|
+
const activeResourceRepositoryContextKey = ( (new RawContextKey('scmActiveResourceRepository', undefined, ( localizeWithPath(_moduleId, 3, "The active resource's repository")))));
|
|
251
253
|
this.scmService.onDidAddRepository(this.onDidAddRepository, this, this.disposables);
|
|
252
254
|
for (const repository of this.scmService.repositories) {
|
|
253
255
|
this.onDidAddRepository(repository);
|
|
254
256
|
}
|
|
255
|
-
|
|
257
|
+
const hasChangesContextKeyProvider = {
|
|
258
|
+
contextKey: activeResourceHasChangesContextKey,
|
|
259
|
+
getGroupContextKeyValue: (group) => this.getEditorHasChanges(group.activeEditor),
|
|
260
|
+
onDidChange: this.onDidRepositoryChange.event
|
|
261
|
+
};
|
|
262
|
+
const repositoryContextKeyProvider = {
|
|
263
|
+
contextKey: activeResourceRepositoryContextKey,
|
|
264
|
+
getGroupContextKeyValue: (group) => this.getEditorRepositoryId(group.activeEditor),
|
|
265
|
+
onDidChange: this.onDidRepositoryChange.event
|
|
266
|
+
};
|
|
267
|
+
this.disposables.add(editorGroupsService.registerContextKeyProvider(hasChangesContextKeyProvider));
|
|
268
|
+
this.disposables.add(editorGroupsService.registerContextKeyProvider(repositoryContextKeyProvider));
|
|
256
269
|
}
|
|
257
270
|
onDidAddRepository(repository) {
|
|
258
271
|
const onDidChange = Event.any(repository.provider.onDidChange, repository.provider.onDidChangeResources);
|
|
259
|
-
const changeDisposable = onDidChange(() =>
|
|
272
|
+
const changeDisposable = onDidChange(() => {
|
|
273
|
+
this.onDidRepositoryChange.fire();
|
|
274
|
+
});
|
|
260
275
|
const onDidRemove = Event.filter(this.scmService.onDidRemoveRepository, e => e === repository);
|
|
261
276
|
const removeDisposable = onDidRemove(() => {
|
|
262
277
|
disposable.dispose();
|
|
263
278
|
this.repositoryDisposables.delete(disposable);
|
|
264
|
-
this.
|
|
279
|
+
this.onDidRepositoryChange.fire();
|
|
265
280
|
});
|
|
266
281
|
const disposable = combinedDisposable(changeDisposable, removeDisposable);
|
|
267
282
|
this.repositoryDisposables.add(disposable);
|
|
268
283
|
}
|
|
269
|
-
|
|
270
|
-
const activeResource = EditorResourceAccessor.getOriginalUri(
|
|
284
|
+
getEditorRepositoryId(activeEditor) {
|
|
285
|
+
const activeResource = EditorResourceAccessor.getOriginalUri(activeEditor);
|
|
286
|
+
if (activeResource?.scheme === Schemas.file || activeResource?.scheme === Schemas.vscodeRemote) {
|
|
287
|
+
const activeResourceRepository = Iterable.find(this.scmService.repositories, r => Boolean(r.provider.rootUri && this.uriIdentityService.extUri.isEqualOrParent(activeResource, r.provider.rootUri)));
|
|
288
|
+
return activeResourceRepository?.id;
|
|
289
|
+
}
|
|
290
|
+
return undefined;
|
|
291
|
+
}
|
|
292
|
+
getEditorHasChanges(activeEditor) {
|
|
293
|
+
const activeResource = EditorResourceAccessor.getOriginalUri(activeEditor);
|
|
271
294
|
if (activeResource?.scheme === Schemas.file || activeResource?.scheme === Schemas.vscodeRemote) {
|
|
272
295
|
const activeResourceRepository = Iterable.find(this.scmService.repositories, r => Boolean(r.provider.rootUri && this.uriIdentityService.extUri.isEqualOrParent(activeResource, r.provider.rootUri)));
|
|
273
|
-
this.activeResourceRepositoryContextKey.set(activeResourceRepository?.id);
|
|
274
296
|
for (const resourceGroup of activeResourceRepository?.provider.groups ?? []) {
|
|
275
297
|
if (( (resourceGroup.resources
|
|
276
298
|
.some(
|
|
277
299
|
scmResource => this.uriIdentityService.extUri.isEqual(activeResource, scmResource.sourceUri)
|
|
278
300
|
)))) {
|
|
279
|
-
|
|
280
|
-
return;
|
|
301
|
+
return true;
|
|
281
302
|
}
|
|
282
303
|
}
|
|
283
|
-
this.activeResourceHasChangesContextKey.set(false);
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
this.activeResourceHasChangesContextKey.set(false);
|
|
287
|
-
this.activeResourceRepositoryContextKey.set(undefined);
|
|
288
304
|
}
|
|
305
|
+
return false;
|
|
289
306
|
}
|
|
290
307
|
dispose() {
|
|
291
308
|
this.disposables.dispose();
|
|
292
309
|
dispose(( (this.repositoryDisposables.values())));
|
|
293
310
|
this.repositoryDisposables.clear();
|
|
311
|
+
this.onDidRepositoryChange.dispose();
|
|
294
312
|
}
|
|
295
313
|
};
|
|
296
314
|
SCMActiveResourceContextKeyController = ( (__decorate([
|
|
297
|
-
( (__param(0,
|
|
298
|
-
( (__param(1,
|
|
299
|
-
( (__param(2,
|
|
300
|
-
( (__param(3, IUriIdentityService)))
|
|
315
|
+
( (__param(0, IEditorGroupsService))),
|
|
316
|
+
( (__param(1, ISCMService))),
|
|
317
|
+
( (__param(2, IUriIdentityService)))
|
|
301
318
|
], SCMActiveResourceContextKeyController)));
|
|
302
319
|
|
|
303
320
|
export { SCMActiveRepositoryContextKeyController, SCMActiveResourceContextKeyController, SCMStatusController };
|
|
@@ -135,7 +135,7 @@ let SCMRepositoryMenus = class SCMRepositoryMenus {
|
|
|
135
135
|
['scmProviderHasRootUri', !!provider.rootUri],
|
|
136
136
|
]);
|
|
137
137
|
const serviceCollection = ( (new ServiceCollection([IContextKeyService, this.contextKeyService])));
|
|
138
|
-
instantiationService = instantiationService.createChild(serviceCollection);
|
|
138
|
+
instantiationService = instantiationService.createChild(serviceCollection, this.disposables);
|
|
139
139
|
this.titleMenu = instantiationService.createInstance(SCMTitleMenu);
|
|
140
140
|
this.disposables.add(this.titleMenu);
|
|
141
141
|
this.repositoryMenu = menuService.createMenu(MenuId.SCMSourceControlInline, this.contextKeyService);
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
2
2
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
3
|
-
import { Extensions, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
3
|
+
import { Extensions, registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
4
4
|
import { DirtyDiffWorkbenchController } from 'vscode/vscode/vs/workbench/contrib/scm/browser/dirtydiffDecorator';
|
|
5
5
|
import { VIEWLET_ID, VIEW_PANE_ID, REPOSITORIES_VIEW_PANE_ID } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm';
|
|
6
6
|
import { ISCMService } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm.service';
|
|
7
|
+
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
7
8
|
import { MenuRegistry, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
8
9
|
import { SCMActiveResourceContextKeyController, SCMActiveRepositoryContextKeyController, SCMStatusController } from './activity.js';
|
|
9
|
-
import {
|
|
10
|
+
import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
11
|
+
import { Extensions as Extensions$2, ConfigurationScope } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
10
12
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
11
13
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
12
14
|
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
13
15
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
14
|
-
import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
15
|
-
import
|
|
16
|
+
import { KeybindingsRegistry, KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
17
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
16
18
|
import '../common/scmService.js';
|
|
17
|
-
import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/views';
|
|
19
|
+
import { Extensions as Extensions$1, ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
18
20
|
import { SCMViewPaneContainer } from './scmViewPaneContainer.js';
|
|
21
|
+
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
19
22
|
import { ModesRegistry } from 'vscode/vscode/vs/editor/common/languages/modesRegistry';
|
|
20
23
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
21
24
|
import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
22
|
-
import { SCMViewPane } from './scmViewPane.js';
|
|
25
|
+
import { SCMViewPane, ContextKeys } from './scmViewPane.js';
|
|
23
26
|
import './scmViewService.js';
|
|
24
27
|
import { SCMRepositoriesViewPane } from './scmRepositoriesViewPane.js';
|
|
25
28
|
import { Context } from 'vscode/vscode/vs/editor/contrib/suggest/browser/suggest';
|
|
@@ -28,6 +31,7 @@ import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
|
28
31
|
import '../common/quickDiffService.js';
|
|
29
32
|
import { getActiveElement } from 'vscode/vscode/vs/base/browser/dom';
|
|
30
33
|
import { SCMWorkingSetController } from './workingSet.js';
|
|
34
|
+
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
31
35
|
|
|
32
36
|
const _moduleId = "vs/workbench/contrib/scm/browser/scm.contribution";
|
|
33
37
|
ModesRegistry.registerLanguage({
|
|
@@ -37,7 +41,7 @@ ModesRegistry.registerLanguage({
|
|
|
37
41
|
mimetypes: ['text/x-scm-input']
|
|
38
42
|
});
|
|
39
43
|
( (Registry.as(Extensions.Workbench)))
|
|
40
|
-
.registerWorkbenchContribution(DirtyDiffWorkbenchController,
|
|
44
|
+
.registerWorkbenchContribution(DirtyDiffWorkbenchController, LifecyclePhase.Restored);
|
|
41
45
|
const sourceControlViewIcon = registerIcon('source-control-view-icon', Codicon.sourceControl, ( localizeWithPath(_moduleId, 0, 'View icon of the Source Control view.')));
|
|
42
46
|
const viewContainer = ( (Registry.as(Extensions$1.ViewContainersRegistry))).registerViewContainer({
|
|
43
47
|
id: VIEWLET_ID,
|
|
@@ -48,7 +52,7 @@ const viewContainer = ( (Registry.as(Extensions$1.ViewContainersRegistry))).regi
|
|
|
48
52
|
alwaysUseContainerInfo: true,
|
|
49
53
|
order: 2,
|
|
50
54
|
hideIfEmpty: true,
|
|
51
|
-
},
|
|
55
|
+
}, ViewContainerLocation.Sidebar, { doNotRegisterOpenCommand: true });
|
|
52
56
|
const viewsRegistry = ( (Registry.as(Extensions$1.ViewsRegistry)));
|
|
53
57
|
viewsRegistry.registerViewWelcomeContent(VIEW_PANE_ID, {
|
|
54
58
|
content: ( localizeWithPath(_moduleId, 2, "No source control providers registered.")),
|
|
@@ -88,9 +92,9 @@ viewsRegistry.registerViews([{
|
|
|
88
92
|
mnemonicTitle: ( localizeWithPath(_moduleId, 5, "Source &&Control")),
|
|
89
93
|
keybindings: {
|
|
90
94
|
primary: 0,
|
|
91
|
-
win: { primary:
|
|
92
|
-
linux: { primary:
|
|
93
|
-
mac: { primary:
|
|
95
|
+
win: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyG },
|
|
96
|
+
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyG },
|
|
97
|
+
mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KeyG },
|
|
94
98
|
},
|
|
95
99
|
order: 2,
|
|
96
100
|
}
|
|
@@ -111,18 +115,18 @@ viewsRegistry.registerViews([{
|
|
|
111
115
|
containerIcon: sourceControlViewIcon
|
|
112
116
|
}], viewContainer);
|
|
113
117
|
( (Registry.as(Extensions.Workbench)))
|
|
114
|
-
.registerWorkbenchContribution(SCMActiveResourceContextKeyController,
|
|
118
|
+
.registerWorkbenchContribution(SCMActiveResourceContextKeyController, LifecyclePhase.Restored);
|
|
115
119
|
( (Registry.as(Extensions.Workbench)))
|
|
116
|
-
.registerWorkbenchContribution(SCMActiveRepositoryContextKeyController,
|
|
120
|
+
.registerWorkbenchContribution(SCMActiveRepositoryContextKeyController, LifecyclePhase.Restored);
|
|
117
121
|
( (Registry.as(Extensions.Workbench)))
|
|
118
|
-
.registerWorkbenchContribution(SCMStatusController,
|
|
119
|
-
registerWorkbenchContribution2(SCMWorkingSetController.ID, SCMWorkingSetController,
|
|
122
|
+
.registerWorkbenchContribution(SCMStatusController, LifecyclePhase.Restored);
|
|
123
|
+
registerWorkbenchContribution2(SCMWorkingSetController.ID, SCMWorkingSetController, WorkbenchPhase.AfterRestored);
|
|
120
124
|
( (Registry.as(Extensions$2.Configuration))).registerConfiguration({
|
|
121
125
|
id: 'scm',
|
|
122
126
|
order: 5,
|
|
123
127
|
title: ( localizeWithPath(_moduleId, 7, "Source Control")),
|
|
124
128
|
type: 'object',
|
|
125
|
-
scope:
|
|
129
|
+
scope: ConfigurationScope.RESOURCE,
|
|
126
130
|
properties: {
|
|
127
131
|
'scm.diffDecorations': {
|
|
128
132
|
type: 'string',
|
|
@@ -485,9 +489,9 @@ registerWorkbenchContribution2(SCMWorkingSetController.ID, SCMWorkingSetControll
|
|
|
485
489
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
486
490
|
id: 'scm.acceptInput',
|
|
487
491
|
metadata: { description: ( localizeWithPath(_moduleId, 70, "Source Control: Accept Input")), args: [] },
|
|
488
|
-
weight:
|
|
492
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
489
493
|
when: ( (ContextKeyExpr.has('scmRepository'))),
|
|
490
|
-
primary:
|
|
494
|
+
primary: KeyMod.CtrlCmd | KeyCode.Enter,
|
|
491
495
|
handler: accessor => {
|
|
492
496
|
const contextKeyService = accessor.get(IContextKeyService);
|
|
493
497
|
const context = contextKeyService.getContext(getActiveElement());
|
|
@@ -508,7 +512,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
508
512
|
});
|
|
509
513
|
const viewNextCommitCommand = {
|
|
510
514
|
description: { description: ( localizeWithPath(_moduleId, 71, "Source Control: View Next Commit")), args: [] },
|
|
511
|
-
weight:
|
|
515
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
512
516
|
handler: (accessor) => {
|
|
513
517
|
const contextKeyService = accessor.get(IContextKeyService);
|
|
514
518
|
const scmService = accessor.get(ISCMService);
|
|
@@ -520,7 +524,7 @@ const viewNextCommitCommand = {
|
|
|
520
524
|
};
|
|
521
525
|
const viewPreviousCommitCommand = {
|
|
522
526
|
description: { description: ( localizeWithPath(_moduleId, 72, "Source Control: View Previous Commit")), args: [] },
|
|
523
|
-
weight:
|
|
527
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
524
528
|
handler: (accessor) => {
|
|
525
529
|
const contextKeyService = accessor.get(IContextKeyService);
|
|
526
530
|
const scmService = accessor.get(ISCMService);
|
|
@@ -538,7 +542,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
538
542
|
(ContextKeyExpr.has('scmInputIsInLastPosition')),
|
|
539
543
|
(Context.Visible.toNegated())
|
|
540
544
|
))),
|
|
541
|
-
primary:
|
|
545
|
+
primary: KeyCode.DownArrow
|
|
542
546
|
});
|
|
543
547
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
544
548
|
...viewPreviousCommitCommand,
|
|
@@ -548,19 +552,19 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
548
552
|
(ContextKeyExpr.has('scmInputIsInFirstPosition')),
|
|
549
553
|
(Context.Visible.toNegated())
|
|
550
554
|
))),
|
|
551
|
-
primary:
|
|
555
|
+
primary: KeyCode.UpArrow
|
|
552
556
|
});
|
|
553
557
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
554
558
|
...viewNextCommitCommand,
|
|
555
559
|
id: 'scm.forceViewNextCommit',
|
|
556
560
|
when: ( (ContextKeyExpr.has('scmRepository'))),
|
|
557
|
-
primary:
|
|
561
|
+
primary: KeyMod.Alt | KeyCode.DownArrow
|
|
558
562
|
});
|
|
559
563
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
560
564
|
...viewPreviousCommitCommand,
|
|
561
565
|
id: 'scm.forceViewPreviousCommit',
|
|
562
566
|
when: ( (ContextKeyExpr.has('scmRepository'))),
|
|
563
|
-
primary:
|
|
567
|
+
primary: KeyMod.Alt | KeyCode.UpArrow
|
|
564
568
|
});
|
|
565
569
|
CommandsRegistry.registerCommand('scm.openInIntegratedTerminal', async (accessor, provider) => {
|
|
566
570
|
if (!provider || !provider.rootUri) {
|
|
@@ -604,3 +608,49 @@ MenuRegistry.appendMenuItem(MenuId.SCMSourceControl, {
|
|
|
604
608
|
))
|
|
605
609
|
)))
|
|
606
610
|
});
|
|
611
|
+
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
612
|
+
id: 'workbench.scm.action.focusPreviousInput',
|
|
613
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
614
|
+
when: ( (ContextKeys.RepositoryVisibilityCount.notEqualsTo(0))),
|
|
615
|
+
handler: async (accessor) => {
|
|
616
|
+
const viewsService = accessor.get(IViewsService);
|
|
617
|
+
const scmView = await viewsService.openView(VIEW_PANE_ID);
|
|
618
|
+
if (scmView) {
|
|
619
|
+
scmView.focusPreviousInput();
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
624
|
+
id: 'workbench.scm.action.focusNextInput',
|
|
625
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
626
|
+
when: ( (ContextKeys.RepositoryVisibilityCount.notEqualsTo(0))),
|
|
627
|
+
handler: async (accessor) => {
|
|
628
|
+
const viewsService = accessor.get(IViewsService);
|
|
629
|
+
const scmView = await viewsService.openView(VIEW_PANE_ID);
|
|
630
|
+
if (scmView) {
|
|
631
|
+
scmView.focusNextInput();
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
636
|
+
id: 'workbench.scm.action.focusPreviousResourceGroup',
|
|
637
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
638
|
+
handler: async (accessor) => {
|
|
639
|
+
const viewsService = accessor.get(IViewsService);
|
|
640
|
+
const scmView = await viewsService.openView(VIEW_PANE_ID);
|
|
641
|
+
if (scmView) {
|
|
642
|
+
scmView.focusPreviousResourceGroup();
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
});
|
|
646
|
+
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
647
|
+
id: 'workbench.scm.action.focusNextResourceGroup',
|
|
648
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
649
|
+
handler: async (accessor) => {
|
|
650
|
+
const viewsService = accessor.get(IViewsService);
|
|
651
|
+
const scmView = await viewsService.openView(VIEW_PANE_ID);
|
|
652
|
+
if (scmView) {
|
|
653
|
+
scmView.focusNextResourceGroup();
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
});
|
|
@@ -18,6 +18,7 @@ import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.s
|
|
|
18
18
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
19
19
|
import { RepositoryRenderer, RepositoryActionRunner } from './scmRepositoryRenderer.js';
|
|
20
20
|
import { getActionViewItemProvider, collectContextMenuActions } from './util.js';
|
|
21
|
+
import { Orientation } from 'vscode/vscode/vs/base/browser/ui/sash/sash';
|
|
21
22
|
import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
|
|
22
23
|
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
23
24
|
import { MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
@@ -71,7 +72,7 @@ let SCMRepositoriesViewPane = class SCMRepositoriesViewPane extends ViewPane {
|
|
|
71
72
|
this._register(this.list.onContextMenu(this.onListContextMenu, this));
|
|
72
73
|
this._register(this.scmViewService.onDidChangeRepositories(this.onDidChangeRepositories, this));
|
|
73
74
|
this._register(this.scmViewService.onDidChangeVisibleRepositories(this.updateListSelection, this));
|
|
74
|
-
if (this.orientation ===
|
|
75
|
+
if (this.orientation === Orientation.VERTICAL) {
|
|
75
76
|
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
76
77
|
if (e.affectsConfiguration('scm.repositories.visible')) {
|
|
77
78
|
this.updateBodySize();
|
|
@@ -94,7 +95,7 @@ let SCMRepositoriesViewPane = class SCMRepositoriesViewPane extends ViewPane {
|
|
|
94
95
|
this.list.layout(height, width);
|
|
95
96
|
}
|
|
96
97
|
updateBodySize() {
|
|
97
|
-
if (this.orientation ===
|
|
98
|
+
if (this.orientation === Orientation.HORIZONTAL) {
|
|
98
99
|
return;
|
|
99
100
|
}
|
|
100
101
|
const visibleCount = this.configurationService.getValue('scm.repositories.visible');
|