@codingame/monaco-vscode-scm-service-override 26.2.2 → 28.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/index.js +6 -2
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/activity.js +5 -5
- package/vscode/src/vs/workbench/contrib/scm/browser/media/scm.css +1 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/menus.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/menus.js +3 -3
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffDecorator.js +3 -3
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffWidget.js +13 -13
- package/vscode/src/vs/workbench/contrib/scm/browser/scm.contribution.js +75 -74
- package/vscode/src/vs/workbench/contrib/scm/browser/scmAccessibilityHelp.js +23 -23
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.js +26 -26
- package/vscode/src/vs/workbench/contrib/scm/browser/scmInput.d.ts +62 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/scmInput.js +830 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoriesViewPane.js +2 -1
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPane.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPane.js +35 -814
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewService.js +2 -1
- package/vscode/src/vs/workbench/contrib/scm/common/scmService.js +10 -8
|
@@ -6,29 +6,27 @@ import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/comm
|
|
|
6
6
|
import { basename, dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
7
7
|
import { Disposable, DisposableStore, toDisposable, combinedDisposable, MutableDisposable, dispose, DisposableMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
8
8
|
import { ViewAction, ViewPane } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
9
|
-
import { append, $,
|
|
9
|
+
import { append, $, isPointerEvent, isActiveElement, clearNode } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
10
10
|
import { asCSSUrl } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/cssValue';
|
|
11
|
-
import { ViewMode, VIEW_PANE_ID, ISCMRepositorySortKey, ISCMRepositorySelectionMode
|
|
11
|
+
import { ViewMode, VIEW_PANE_ID, ISCMRepositorySortKey, ISCMRepositorySelectionMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/scm';
|
|
12
12
|
import { ISCMViewService, ISCMService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/scm.service';
|
|
13
13
|
import { ResourceLabels } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/labels';
|
|
14
14
|
import { CountBadge } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/countBadge/countBadge';
|
|
15
15
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
16
16
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
17
|
-
import { IContextMenuService
|
|
17
|
+
import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
|
|
18
18
|
import { RawContextKey, ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
19
19
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
20
20
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
21
21
|
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
22
22
|
import { MenuItemAction, MenuId, MenuRegistry, Action2, registerAction2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
23
23
|
import { IMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service';
|
|
24
|
-
import { ActionRunner,
|
|
25
|
-
import { ActionBar } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
24
|
+
import { ActionRunner, toAction, Separator } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
|
|
26
25
|
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
27
26
|
import { isSCMResource, connectPrimaryMenu, isSCMResourceGroup, isSCMInput, isSCMActionButton, isSCMRepository, isSCMResourceNode, getActionViewItemProvider, collectContextMenuActions, isSCMViewService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/browser/util';
|
|
28
27
|
import { WorkbenchCompressibleAsyncDataTree } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService';
|
|
29
|
-
import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
|
|
30
28
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
31
|
-
import { disposableTimeout,
|
|
29
|
+
import { disposableTimeout, Sequencer, Throttler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
32
30
|
import { ResourceTree } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resourceTree';
|
|
33
31
|
import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
|
|
34
32
|
import { FileKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
@@ -39,73 +37,37 @@ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
|
39
37
|
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
40
38
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
41
39
|
import { EditorResourceAccessor, SideBySideEditor } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
42
|
-
import {
|
|
43
|
-
import { getSimpleEditorOptions, setupSimpleEditorSelectionStyling } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
|
|
44
|
-
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
|
|
45
|
-
import { EditorExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions';
|
|
46
|
-
import { MenuPreventer } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/menuPreventer';
|
|
47
|
-
import { SelectionClipboardContributionID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/selectionClipboard';
|
|
48
|
-
import { EditorDictation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation';
|
|
49
|
-
import { ContextMenuController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/contextmenu/browser/contextmenu';
|
|
50
|
-
import { isMacintosh } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
51
|
-
import { compare, format } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
52
|
-
import { SuggestController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/suggest/browser/suggestController';
|
|
53
|
-
import { SnippetController2 } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/snippet/browser/snippetController2';
|
|
54
|
-
import { ServiceCollection } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
55
|
-
import { ColorDetector } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/colorPicker/browser/colorDetector';
|
|
56
|
-
import { LinkDetector } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/links/browser/links';
|
|
40
|
+
import { compare } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
57
41
|
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
58
42
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
59
43
|
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
60
|
-
import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
61
|
-
import { DEFAULT_FONT_FAMILY } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/fonts';
|
|
62
44
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
63
45
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
64
|
-
import { AnchorAlignment } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/contextview/contextview';
|
|
65
46
|
import { RepositoryRenderer, RepositoryActionRunner } from './scmRepositoryRenderer.js';
|
|
66
47
|
import { isDark } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/theme';
|
|
67
48
|
import { API_OPEN_EDITOR_COMMAND_ID, API_OPEN_DIFF_EDITOR_COMMAND_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
68
|
-
import {
|
|
69
|
-
import { openLinkFromMarkdown } from '@codingame/monaco-vscode-api/vscode/vs/platform/markdown/browser/markdownRenderer';
|
|
70
|
-
import { IMarkdownRendererService } from '@codingame/monaco-vscode-api/vscode/vs/platform/markdown/browser/markdownRenderer.service';
|
|
49
|
+
import { getFlatContextMenuActions } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
71
50
|
import { ButtonWithDropdown, Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
|
|
72
51
|
import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
|
|
73
52
|
import { RepositoryContextKeys } from './scmViewService.js';
|
|
74
|
-
import { DragAndDropController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/dnd/browser/dnd';
|
|
75
|
-
import { CopyPasteController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController';
|
|
76
|
-
import { DropIntoEditorController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController';
|
|
77
|
-
import { MessageController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/message/browser/messageController';
|
|
78
53
|
import { defaultCountBadgeStyles, defaultButtonStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
|
|
79
|
-
import { InlineCompletionsController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController';
|
|
80
|
-
import { CodeActionController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/codeAction/browser/codeActionController';
|
|
81
54
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
82
55
|
import { fillEditorsDragData } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/dnd';
|
|
83
56
|
import { CodeDataTransfers } from '@codingame/monaco-vscode-api/vscode/vs/platform/dnd/browser/dnd';
|
|
84
|
-
import { FormatOnType } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/format/browser/formatActions';
|
|
85
|
-
import { EditorOptions, EditorOption } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/config/editorOptions';
|
|
86
57
|
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
90
|
-
import { DropdownWithPrimaryActionViewItem } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem';
|
|
91
|
-
import { clamp, rot } from '@codingame/monaco-vscode-api/vscode/vs/base/common/numbers';
|
|
58
|
+
import { WorkbenchToolBar } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
|
|
59
|
+
import { rot } from '@codingame/monaco-vscode-api/vscode/vs/base/common/numbers';
|
|
92
60
|
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
93
61
|
import { OpenScmGroupAction } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver';
|
|
94
|
-
import { ContentHoverController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/hover/browser/contentHoverController';
|
|
95
|
-
import { GlyphHoverController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/hover/browser/glyphHoverController';
|
|
96
62
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
97
|
-
import { PlaceholderTextContribution } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/placeholderText/browser/placeholderTextContribution';
|
|
98
63
|
import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
99
64
|
import { AccessibilityVerbositySettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
100
65
|
import { IAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
101
66
|
import { AccessibilityCommandId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/common/accessibilityCommands';
|
|
102
|
-
import {
|
|
103
|
-
import product from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/product';
|
|
104
|
-
import { CHAT_SETUP_SUPPORT_ANONYMOUS_ACTION_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
105
|
-
import { runOnChange } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils/runOnChange';
|
|
67
|
+
import { SCMInputWidget } from './scmInput.js';
|
|
106
68
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
107
69
|
|
|
108
|
-
var ActionButtonRenderer_1, InputRenderer_1, ResourceGroupRenderer_1, ResourceRenderer_1
|
|
70
|
+
var ActionButtonRenderer_1, InputRenderer_1, ResourceGroupRenderer_1, ResourceRenderer_1;
|
|
109
71
|
registerCss(scm);
|
|
110
72
|
function processResourceFilterData(uri, filterData) {
|
|
111
73
|
if (!filterData) {
|
|
@@ -823,7 +785,7 @@ let SCMAccessibilityProvider = class SCMAccessibilityProvider {
|
|
|
823
785
|
this.labelService = labelService;
|
|
824
786
|
}
|
|
825
787
|
getWidgetAriaLabel() {
|
|
826
|
-
return localize(
|
|
788
|
+
return localize(12077, "Source Control Management");
|
|
827
789
|
}
|
|
828
790
|
getAriaLabel(element) {
|
|
829
791
|
if (ResourceTree.isResourceNode(element)) {
|
|
@@ -836,15 +798,15 @@ let SCMAccessibilityProvider = class SCMAccessibilityProvider {
|
|
|
836
798
|
} else if (isSCMInput(element)) {
|
|
837
799
|
const verbosity = this.configurationService.getValue(AccessibilityVerbositySettingId.SourceControl) === true;
|
|
838
800
|
if (!verbosity || !this.accessibilityService.isScreenReaderOptimized()) {
|
|
839
|
-
return localize(
|
|
801
|
+
return localize(12078, "Source Control Input");
|
|
840
802
|
}
|
|
841
803
|
const kbLabel = this.keybindingService.lookupKeybinding(AccessibilityCommandId.OpenAccessibilityHelp)?.getLabel();
|
|
842
804
|
return kbLabel ? ( localize(
|
|
843
|
-
|
|
805
|
+
12079,
|
|
844
806
|
"Source Control Input, Use {0} to open Source Control Accessibility Help.",
|
|
845
807
|
kbLabel
|
|
846
808
|
)) : ( localize(
|
|
847
|
-
|
|
809
|
+
12080,
|
|
848
810
|
"Source Control Input, Run the Open Accessibility Help command for more information."
|
|
849
811
|
));
|
|
850
812
|
} else if (isSCMActionButton(element)) {
|
|
@@ -893,20 +855,19 @@ const ContextKeys = {
|
|
|
893
855
|
SCMCurrentHistoryItemRefInFilter: ( new RawContextKey("scmCurrentHistoryItemRefInFilter", false)),
|
|
894
856
|
RepositoryCount: ( new RawContextKey("scmRepositoryCount", 0)),
|
|
895
857
|
RepositoryVisibilityCount: ( new RawContextKey("scmRepositoryVisibleCount", 0)),
|
|
896
|
-
SCMInputHasValidationMessage: ( new RawContextKey("scmInputHasValidationMessage", false)),
|
|
897
858
|
RepositoryVisibility(repository) {
|
|
898
859
|
return ( new RawContextKey(`scmRepositoryVisible:${repository.provider.id}`, false));
|
|
899
860
|
}
|
|
900
861
|
};
|
|
901
862
|
MenuRegistry.appendMenuItem(MenuId.SCMTitle, {
|
|
902
|
-
title: ( localize(
|
|
863
|
+
title: ( localize(12081, "View & Sort")),
|
|
903
864
|
submenu: Menus.ViewSort,
|
|
904
865
|
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals("view", VIEW_PANE_ID)), ( ContextKeys.RepositoryCount.notEqualsTo(0)))),
|
|
905
866
|
group: "0_view&sort",
|
|
906
867
|
order: 1
|
|
907
868
|
});
|
|
908
869
|
MenuRegistry.appendMenuItem(Menus.ViewSort, {
|
|
909
|
-
title: ( localize(
|
|
870
|
+
title: ( localize(12082, "Repositories")),
|
|
910
871
|
submenu: Menus.Repositories,
|
|
911
872
|
when: ContextKeyExpr.greater(ContextKeys.RepositoryCount.key, 1),
|
|
912
873
|
group: "0_repositories"
|
|
@@ -998,7 +959,7 @@ class SetListViewModeAction extends ViewAction {
|
|
|
998
959
|
constructor(id = "workbench.scm.action.setListViewMode", menu = {}) {
|
|
999
960
|
super({
|
|
1000
961
|
id,
|
|
1001
|
-
title: ( localize(
|
|
962
|
+
title: ( localize(12083, "View as List")),
|
|
1002
963
|
viewId: VIEW_PANE_ID,
|
|
1003
964
|
f1: false,
|
|
1004
965
|
icon: Codicon.listTree,
|
|
@@ -1029,7 +990,7 @@ class SetTreeViewModeAction extends ViewAction {
|
|
|
1029
990
|
constructor(id = "workbench.scm.action.setTreeViewMode", menu = {}) {
|
|
1030
991
|
super({
|
|
1031
992
|
id,
|
|
1032
|
-
title: ( localize(
|
|
993
|
+
title: ( localize(12084, "View as Tree")),
|
|
1033
994
|
viewId: VIEW_PANE_ID,
|
|
1034
995
|
f1: false,
|
|
1035
996
|
icon: Codicon.listFlat,
|
|
@@ -1083,17 +1044,17 @@ class RepositorySortAction extends Action2 {
|
|
|
1083
1044
|
}
|
|
1084
1045
|
class RepositorySortByDiscoveryTimeAction extends RepositorySortAction {
|
|
1085
1046
|
constructor() {
|
|
1086
|
-
super(ISCMRepositorySortKey.DiscoveryTime, ( localize(
|
|
1047
|
+
super(ISCMRepositorySortKey.DiscoveryTime, ( localize(12085, "Sort by Discovery Time")));
|
|
1087
1048
|
}
|
|
1088
1049
|
}
|
|
1089
1050
|
class RepositorySortByNameAction extends RepositorySortAction {
|
|
1090
1051
|
constructor() {
|
|
1091
|
-
super(ISCMRepositorySortKey.Name, ( localize(
|
|
1052
|
+
super(ISCMRepositorySortKey.Name, ( localize(12086, "Sort by Name")));
|
|
1092
1053
|
}
|
|
1093
1054
|
}
|
|
1094
1055
|
class RepositorySortByPathAction extends RepositorySortAction {
|
|
1095
1056
|
constructor() {
|
|
1096
|
-
super(ISCMRepositorySortKey.Path, ( localize(
|
|
1057
|
+
super(ISCMRepositorySortKey.Path, ( localize(12087, "Sort by Path")));
|
|
1097
1058
|
}
|
|
1098
1059
|
}
|
|
1099
1060
|
registerAction2(RepositorySortByDiscoveryTimeAction);
|
|
@@ -1126,12 +1087,12 @@ class RepositorySelectionModeAction extends Action2 {
|
|
|
1126
1087
|
}
|
|
1127
1088
|
class RepositorySingleSelectionModeAction extends RepositorySelectionModeAction {
|
|
1128
1089
|
constructor() {
|
|
1129
|
-
super(ISCMRepositorySelectionMode.Single, ( localize(
|
|
1090
|
+
super(ISCMRepositorySelectionMode.Single, ( localize(12088, "Select Single Repository")), 1);
|
|
1130
1091
|
}
|
|
1131
1092
|
}
|
|
1132
1093
|
class RepositoryMultiSelectionModeAction extends RepositorySelectionModeAction {
|
|
1133
1094
|
constructor() {
|
|
1134
|
-
super(ISCMRepositorySelectionMode.Multiple, ( localize(
|
|
1095
|
+
super(ISCMRepositorySelectionMode.Multiple, ( localize(12089, "Select Multiple Repositories")), 2);
|
|
1135
1096
|
}
|
|
1136
1097
|
}
|
|
1137
1098
|
registerAction2(RepositorySingleSelectionModeAction);
|
|
@@ -1158,17 +1119,17 @@ class SetSortKeyAction extends ViewAction {
|
|
|
1158
1119
|
}
|
|
1159
1120
|
class SetSortByNameAction extends SetSortKeyAction {
|
|
1160
1121
|
constructor() {
|
|
1161
|
-
super(ViewSortKey.Name, ( localize(
|
|
1122
|
+
super(ViewSortKey.Name, ( localize(12090, "Sort Changes by Name")));
|
|
1162
1123
|
}
|
|
1163
1124
|
}
|
|
1164
1125
|
class SetSortByPathAction extends SetSortKeyAction {
|
|
1165
1126
|
constructor() {
|
|
1166
|
-
super(ViewSortKey.Path, ( localize(
|
|
1127
|
+
super(ViewSortKey.Path, ( localize(12091, "Sort Changes by Path")));
|
|
1167
1128
|
}
|
|
1168
1129
|
}
|
|
1169
1130
|
class SetSortByStatusAction extends SetSortKeyAction {
|
|
1170
1131
|
constructor() {
|
|
1171
|
-
super(ViewSortKey.Status, ( localize(
|
|
1132
|
+
super(ViewSortKey.Status, ( localize(12092, "Sort Changes by Status")));
|
|
1172
1133
|
}
|
|
1173
1134
|
}
|
|
1174
1135
|
registerAction2(SetSortByNameAction);
|
|
@@ -1178,7 +1139,7 @@ class CollapseAllRepositoriesAction extends ViewAction {
|
|
|
1178
1139
|
constructor() {
|
|
1179
1140
|
super({
|
|
1180
1141
|
id: `workbench.scm.action.collapseAllRepositories`,
|
|
1181
|
-
title: ( localize(
|
|
1142
|
+
title: ( localize(12093, "Collapse All Repositories")),
|
|
1182
1143
|
viewId: VIEW_PANE_ID,
|
|
1183
1144
|
f1: false,
|
|
1184
1145
|
icon: Codicon.collapseAll,
|
|
@@ -1197,7 +1158,7 @@ class ExpandAllRepositoriesAction extends ViewAction {
|
|
|
1197
1158
|
constructor() {
|
|
1198
1159
|
super({
|
|
1199
1160
|
id: `workbench.scm.action.expandAllRepositories`,
|
|
1200
|
-
title: ( localize(
|
|
1161
|
+
title: ( localize(12094, "Expand All Repositories")),
|
|
1201
1162
|
viewId: VIEW_PANE_ID,
|
|
1202
1163
|
f1: false,
|
|
1203
1164
|
icon: Codicon.expandAll,
|
|
@@ -1218,7 +1179,7 @@ class CollapseAllAction extends ViewAction {
|
|
|
1218
1179
|
constructor() {
|
|
1219
1180
|
super({
|
|
1220
1181
|
id: `workbench.scm.action.collapseAll`,
|
|
1221
|
-
title: ( localize(
|
|
1182
|
+
title: ( localize(12095, "Collapse All")),
|
|
1222
1183
|
viewId: VIEW_PANE_ID,
|
|
1223
1184
|
f1: false,
|
|
1224
1185
|
icon: Codicon.collapseAll,
|
|
@@ -1236,747 +1197,6 @@ class CollapseAllAction extends ViewAction {
|
|
|
1236
1197
|
}
|
|
1237
1198
|
}
|
|
1238
1199
|
registerAction2(CollapseAllAction);
|
|
1239
|
-
var SCMInputWidgetCommandId;
|
|
1240
|
-
(function(SCMInputWidgetCommandId) {
|
|
1241
|
-
SCMInputWidgetCommandId["CancelAction"] = "scm.input.cancelAction";
|
|
1242
|
-
SCMInputWidgetCommandId["SetupAction"] = "scm.input.triggerSetup";
|
|
1243
|
-
})(SCMInputWidgetCommandId || (SCMInputWidgetCommandId = {}));
|
|
1244
|
-
var SCMInputWidgetStorageKey;
|
|
1245
|
-
(function(SCMInputWidgetStorageKey) {
|
|
1246
|
-
SCMInputWidgetStorageKey["LastActionId"] = "scm.input.lastActionId";
|
|
1247
|
-
})(SCMInputWidgetStorageKey || (SCMInputWidgetStorageKey = {}));
|
|
1248
|
-
registerAction2(class extends Action2 {
|
|
1249
|
-
constructor() {
|
|
1250
|
-
super({
|
|
1251
|
-
id: SCMInputWidgetCommandId.SetupAction,
|
|
1252
|
-
title: ( localize(11139, "Generate Commit Message")),
|
|
1253
|
-
icon: Codicon.sparkle,
|
|
1254
|
-
f1: false,
|
|
1255
|
-
menu: {
|
|
1256
|
-
id: MenuId.SCMInputBox,
|
|
1257
|
-
when: ( ContextKeyExpr.and(( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabled.negate()), ( ChatContextKeys.Setup.installed.negate()), ( ContextKeyExpr.equals("scmProvider", "git"))))
|
|
1258
|
-
}
|
|
1259
|
-
});
|
|
1260
|
-
}
|
|
1261
|
-
async run(accessor, ...args) {
|
|
1262
|
-
const commandService = accessor.get(ICommandService);
|
|
1263
|
-
const result = await commandService.executeCommand(CHAT_SETUP_SUPPORT_ANONYMOUS_ACTION_ID);
|
|
1264
|
-
if (!result) {
|
|
1265
|
-
return;
|
|
1266
|
-
}
|
|
1267
|
-
const command = product.defaultChatAgent?.generateCommitMessageCommand;
|
|
1268
|
-
if (!command) {
|
|
1269
|
-
return;
|
|
1270
|
-
}
|
|
1271
|
-
await commandService.executeCommand(command, ...args);
|
|
1272
|
-
}
|
|
1273
|
-
});
|
|
1274
|
-
let SCMInputWidgetActionRunner = class SCMInputWidgetActionRunner extends ActionRunner {
|
|
1275
|
-
get runningActions() {
|
|
1276
|
-
return this._runningActions;
|
|
1277
|
-
}
|
|
1278
|
-
constructor(input, storageService) {
|
|
1279
|
-
super();
|
|
1280
|
-
this.input = input;
|
|
1281
|
-
this.storageService = storageService;
|
|
1282
|
-
this._runningActions = ( new Set());
|
|
1283
|
-
}
|
|
1284
|
-
async runAction(action) {
|
|
1285
|
-
try {
|
|
1286
|
-
if (this.runningActions.size !== 0) {
|
|
1287
|
-
this._cts?.cancel();
|
|
1288
|
-
if (action.id === SCMInputWidgetCommandId.CancelAction) {
|
|
1289
|
-
return;
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
const context = [];
|
|
1293
|
-
for (const group of this.input.repository.provider.groups) {
|
|
1294
|
-
context.push({
|
|
1295
|
-
resourceGroupId: group.id,
|
|
1296
|
-
resources: [...( group.resources.map(r => r.sourceUri))]
|
|
1297
|
-
});
|
|
1298
|
-
}
|
|
1299
|
-
this._runningActions.add(action);
|
|
1300
|
-
this._cts = ( new CancellationTokenSource());
|
|
1301
|
-
await action.run(...[this.input.repository.provider.rootUri, context, this._cts.token]);
|
|
1302
|
-
} finally {
|
|
1303
|
-
this._runningActions.delete(action);
|
|
1304
|
-
if (this._runningActions.size === 0) {
|
|
1305
|
-
const actionId = action.id === SCMInputWidgetCommandId.SetupAction ? product.defaultChatAgent?.generateCommitMessageCommand ?? action.id : action.id;
|
|
1306
|
-
this.storageService.store(
|
|
1307
|
-
SCMInputWidgetStorageKey.LastActionId,
|
|
1308
|
-
actionId,
|
|
1309
|
-
StorageScope.PROFILE,
|
|
1310
|
-
StorageTarget.USER
|
|
1311
|
-
);
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
};
|
|
1316
|
-
SCMInputWidgetActionRunner = ( __decorate([( __param(1, IStorageService))], SCMInputWidgetActionRunner));
|
|
1317
|
-
let SCMInputWidgetToolbar = class SCMInputWidgetToolbar extends WorkbenchToolBar {
|
|
1318
|
-
get dropdownActions() {
|
|
1319
|
-
return this._dropdownActions;
|
|
1320
|
-
}
|
|
1321
|
-
get dropdownAction() {
|
|
1322
|
-
return this._dropdownAction;
|
|
1323
|
-
}
|
|
1324
|
-
constructor(
|
|
1325
|
-
container,
|
|
1326
|
-
options,
|
|
1327
|
-
menuService,
|
|
1328
|
-
contextKeyService,
|
|
1329
|
-
contextMenuService,
|
|
1330
|
-
commandService,
|
|
1331
|
-
keybindingService,
|
|
1332
|
-
storageService,
|
|
1333
|
-
telemetryService
|
|
1334
|
-
) {
|
|
1335
|
-
super(
|
|
1336
|
-
container,
|
|
1337
|
-
options,
|
|
1338
|
-
menuService,
|
|
1339
|
-
contextKeyService,
|
|
1340
|
-
contextMenuService,
|
|
1341
|
-
keybindingService,
|
|
1342
|
-
commandService,
|
|
1343
|
-
telemetryService
|
|
1344
|
-
);
|
|
1345
|
-
this.menuService = menuService;
|
|
1346
|
-
this.contextKeyService = contextKeyService;
|
|
1347
|
-
this.storageService = storageService;
|
|
1348
|
-
this._dropdownActions = [];
|
|
1349
|
-
this._onDidChange = ( new Emitter());
|
|
1350
|
-
this.onDidChange = this._onDidChange.event;
|
|
1351
|
-
this._disposables = this._register(( new MutableDisposable()));
|
|
1352
|
-
this._dropdownAction = ( new Action("scmInputMoreActions", ( localize(11140, "More Actions...")), "codicon-chevron-down"));
|
|
1353
|
-
this._cancelAction = ( new MenuItemAction({
|
|
1354
|
-
id: SCMInputWidgetCommandId.CancelAction,
|
|
1355
|
-
title: ( localize(11141, "Cancel")),
|
|
1356
|
-
icon: Codicon.stopCircle
|
|
1357
|
-
}, undefined, undefined, undefined, undefined, contextKeyService, commandService));
|
|
1358
|
-
}
|
|
1359
|
-
setInput(input) {
|
|
1360
|
-
this._disposables.value = ( new DisposableStore());
|
|
1361
|
-
const contextKeyService = this.contextKeyService.createOverlay([
|
|
1362
|
-
["scmProvider", input.repository.provider.providerId],
|
|
1363
|
-
["scmProviderRootUri", input.repository.provider.rootUri?.toString()],
|
|
1364
|
-
["scmProviderHasRootUri", !!input.repository.provider.rootUri]
|
|
1365
|
-
]);
|
|
1366
|
-
const menu = this._disposables.value.add(this.menuService.createMenu(MenuId.SCMInputBox, contextKeyService, {
|
|
1367
|
-
emitEventsForSubmenuChanges: true
|
|
1368
|
-
}));
|
|
1369
|
-
const isEnabled = () => {
|
|
1370
|
-
return ( input.repository.provider.groups.some(g => g.resources.length > 0));
|
|
1371
|
-
};
|
|
1372
|
-
const updateToolbar = () => {
|
|
1373
|
-
const actions = getFlatActionBarActions(menu.getActions({
|
|
1374
|
-
shouldForwardArgs: true
|
|
1375
|
-
}));
|
|
1376
|
-
for (const action of actions) {
|
|
1377
|
-
action.enabled = isEnabled();
|
|
1378
|
-
}
|
|
1379
|
-
this._dropdownAction.enabled = isEnabled();
|
|
1380
|
-
let primaryAction = undefined;
|
|
1381
|
-
if (this.actionRunner.runningActions.size !== 0) {
|
|
1382
|
-
primaryAction = this._cancelAction;
|
|
1383
|
-
} else if (actions.length === 1) {
|
|
1384
|
-
primaryAction = actions[0];
|
|
1385
|
-
} else if (actions.length > 1) {
|
|
1386
|
-
const lastActionId = this.storageService.get(SCMInputWidgetStorageKey.LastActionId, StorageScope.PROFILE, "");
|
|
1387
|
-
primaryAction = actions.find(a => a.id === lastActionId) ?? actions[0];
|
|
1388
|
-
}
|
|
1389
|
-
this._dropdownActions = actions.length === 1 ? [] : actions;
|
|
1390
|
-
super.setActions(primaryAction ? [primaryAction] : [], []);
|
|
1391
|
-
this._onDidChange.fire();
|
|
1392
|
-
};
|
|
1393
|
-
this._disposables.value.add(menu.onDidChange(() => updateToolbar()));
|
|
1394
|
-
this._disposables.value.add(input.repository.provider.onDidChangeResources(() => updateToolbar()));
|
|
1395
|
-
this._disposables.value.add(this.storageService.onDidChangeValue(
|
|
1396
|
-
StorageScope.PROFILE,
|
|
1397
|
-
SCMInputWidgetStorageKey.LastActionId,
|
|
1398
|
-
this._disposables.value
|
|
1399
|
-
)(() => updateToolbar()));
|
|
1400
|
-
this.actionRunner = this._disposables.value.add(( new SCMInputWidgetActionRunner(input, this.storageService)));
|
|
1401
|
-
this._disposables.value.add(this.actionRunner.onWillRun(e => {
|
|
1402
|
-
if (this.actionRunner.runningActions.size === 0) {
|
|
1403
|
-
super.setActions([this._cancelAction], []);
|
|
1404
|
-
this._onDidChange.fire();
|
|
1405
|
-
}
|
|
1406
|
-
}));
|
|
1407
|
-
this._disposables.value.add(this.actionRunner.onDidRun(e => {
|
|
1408
|
-
if (this.actionRunner.runningActions.size === 0) {
|
|
1409
|
-
updateToolbar();
|
|
1410
|
-
}
|
|
1411
|
-
}));
|
|
1412
|
-
updateToolbar();
|
|
1413
|
-
}
|
|
1414
|
-
};
|
|
1415
|
-
SCMInputWidgetToolbar = ( __decorate([( __param(2, IMenuService)), ( __param(3, IContextKeyService)), ( __param(4, IContextMenuService)), ( __param(5, ICommandService)), ( __param(6, IKeybindingService)), ( __param(7, IStorageService)), ( __param(8, ITelemetryService))], SCMInputWidgetToolbar));
|
|
1416
|
-
class SCMInputWidgetEditorOptions {
|
|
1417
|
-
constructor(overflowWidgetsDomNode, configurationService) {
|
|
1418
|
-
this.overflowWidgetsDomNode = overflowWidgetsDomNode;
|
|
1419
|
-
this.configurationService = configurationService;
|
|
1420
|
-
this._onDidChange = ( new Emitter());
|
|
1421
|
-
this.onDidChange = this._onDidChange.event;
|
|
1422
|
-
this.defaultInputFontFamily = DEFAULT_FONT_FAMILY;
|
|
1423
|
-
this._disposables = ( new DisposableStore());
|
|
1424
|
-
const onDidChangeConfiguration = Event.filter(this.configurationService.onDidChangeConfiguration, e => {
|
|
1425
|
-
return e.affectsConfiguration("editor.accessibilitySupport") || e.affectsConfiguration("editor.cursorBlinking") || e.affectsConfiguration("editor.cursorStyle") || e.affectsConfiguration("editor.cursorWidth") || e.affectsConfiguration("editor.emptySelectionClipboard") || e.affectsConfiguration("editor.fontFamily") || e.affectsConfiguration("editor.rulers") || e.affectsConfiguration("editor.wordWrap") || e.affectsConfiguration("editor.wordSegmenterLocales") || e.affectsConfiguration("scm.inputFontFamily") || e.affectsConfiguration("scm.inputFontSize");
|
|
1426
|
-
}, this._disposables);
|
|
1427
|
-
this._disposables.add(onDidChangeConfiguration(() => this._onDidChange.fire()));
|
|
1428
|
-
}
|
|
1429
|
-
getEditorConstructionOptions() {
|
|
1430
|
-
return {
|
|
1431
|
-
...getSimpleEditorOptions(this.configurationService),
|
|
1432
|
-
...this.getEditorOptions(),
|
|
1433
|
-
dragAndDrop: true,
|
|
1434
|
-
dropIntoEditor: {
|
|
1435
|
-
enabled: true
|
|
1436
|
-
},
|
|
1437
|
-
formatOnType: true,
|
|
1438
|
-
lineDecorationsWidth: 6,
|
|
1439
|
-
overflowWidgetsDomNode: this.overflowWidgetsDomNode,
|
|
1440
|
-
padding: {
|
|
1441
|
-
top: 2,
|
|
1442
|
-
bottom: 2
|
|
1443
|
-
},
|
|
1444
|
-
quickSuggestions: false,
|
|
1445
|
-
renderWhitespace: "none",
|
|
1446
|
-
scrollbar: {
|
|
1447
|
-
alwaysConsumeMouseWheel: false,
|
|
1448
|
-
vertical: "hidden"
|
|
1449
|
-
},
|
|
1450
|
-
wrappingIndent: "none",
|
|
1451
|
-
wrappingStrategy: "advanced"
|
|
1452
|
-
};
|
|
1453
|
-
}
|
|
1454
|
-
getEditorOptions() {
|
|
1455
|
-
const fontFamily = this._getEditorFontFamily();
|
|
1456
|
-
const fontSize = this._getEditorFontSize();
|
|
1457
|
-
const lineHeight = this._getEditorLineHeight(fontSize);
|
|
1458
|
-
const wordSegmenterLocales = this.configurationService.getValue("editor.wordSegmenterLocales");
|
|
1459
|
-
const accessibilitySupport = this.configurationService.getValue("editor.accessibilitySupport");
|
|
1460
|
-
const cursorBlinking = this.configurationService.getValue("editor.cursorBlinking");
|
|
1461
|
-
const cursorStyle = this.configurationService.getValue("editor.cursorStyle");
|
|
1462
|
-
const cursorWidth = this.configurationService.getValue("editor.cursorWidth") ?? 1;
|
|
1463
|
-
const emptySelectionClipboard = this.configurationService.getValue("editor.emptySelectionClipboard") === true;
|
|
1464
|
-
return {
|
|
1465
|
-
...this._getEditorLanguageConfiguration(),
|
|
1466
|
-
accessibilitySupport,
|
|
1467
|
-
cursorBlinking,
|
|
1468
|
-
cursorStyle,
|
|
1469
|
-
cursorWidth,
|
|
1470
|
-
fontFamily,
|
|
1471
|
-
fontSize,
|
|
1472
|
-
lineHeight,
|
|
1473
|
-
emptySelectionClipboard,
|
|
1474
|
-
wordSegmenterLocales
|
|
1475
|
-
};
|
|
1476
|
-
}
|
|
1477
|
-
_getEditorFontFamily() {
|
|
1478
|
-
const inputFontFamily = this.configurationService.getValue("scm.inputFontFamily").trim();
|
|
1479
|
-
if (inputFontFamily.toLowerCase() === "editor") {
|
|
1480
|
-
return this.configurationService.getValue("editor.fontFamily").trim();
|
|
1481
|
-
}
|
|
1482
|
-
if (inputFontFamily.length !== 0 && inputFontFamily.toLowerCase() !== "default") {
|
|
1483
|
-
return inputFontFamily;
|
|
1484
|
-
}
|
|
1485
|
-
return this.defaultInputFontFamily;
|
|
1486
|
-
}
|
|
1487
|
-
_getEditorFontSize() {
|
|
1488
|
-
return this.configurationService.getValue("scm.inputFontSize");
|
|
1489
|
-
}
|
|
1490
|
-
_getEditorLanguageConfiguration() {
|
|
1491
|
-
const rulersConfig = this.configurationService.inspect("editor.rulers", {
|
|
1492
|
-
overrideIdentifier: "scminput"
|
|
1493
|
-
});
|
|
1494
|
-
const rulers = rulersConfig.overrideIdentifiers?.includes("scminput") ? EditorOptions.rulers.validate(rulersConfig.value) : [];
|
|
1495
|
-
const wordWrapConfig = this.configurationService.inspect("editor.wordWrap", {
|
|
1496
|
-
overrideIdentifier: "scminput"
|
|
1497
|
-
});
|
|
1498
|
-
const wordWrap = wordWrapConfig.overrideIdentifiers?.includes("scminput") ? EditorOptions.wordWrap.validate(wordWrapConfig.value) : "on";
|
|
1499
|
-
return {
|
|
1500
|
-
rulers,
|
|
1501
|
-
wordWrap
|
|
1502
|
-
};
|
|
1503
|
-
}
|
|
1504
|
-
_getEditorLineHeight(fontSize) {
|
|
1505
|
-
return Math.round(fontSize * 1.5);
|
|
1506
|
-
}
|
|
1507
|
-
dispose() {
|
|
1508
|
-
this._disposables.dispose();
|
|
1509
|
-
}
|
|
1510
|
-
}
|
|
1511
|
-
let SCMInputWidget = class SCMInputWidget {
|
|
1512
|
-
static {
|
|
1513
|
-
SCMInputWidget_1 = this;
|
|
1514
|
-
}
|
|
1515
|
-
static {
|
|
1516
|
-
this.ValidationTimeouts = {
|
|
1517
|
-
[InputValidationType.Information]: 5000,
|
|
1518
|
-
[InputValidationType.Warning]: 8000,
|
|
1519
|
-
[InputValidationType.Error]: 10000
|
|
1520
|
-
};
|
|
1521
|
-
}
|
|
1522
|
-
get input() {
|
|
1523
|
-
return this.model?.input;
|
|
1524
|
-
}
|
|
1525
|
-
set input(input) {
|
|
1526
|
-
if (input === this.input) {
|
|
1527
|
-
return;
|
|
1528
|
-
}
|
|
1529
|
-
this.clearValidation();
|
|
1530
|
-
this.element.classList.remove("synthetic-focus");
|
|
1531
|
-
this.repositoryDisposables.clear();
|
|
1532
|
-
this.repositoryIdContextKey.set(input?.repository.id);
|
|
1533
|
-
if (!input) {
|
|
1534
|
-
this.inputEditor.setModel(undefined);
|
|
1535
|
-
this.model = undefined;
|
|
1536
|
-
return;
|
|
1537
|
-
}
|
|
1538
|
-
const textModel = input.repository.provider.inputBoxTextModel;
|
|
1539
|
-
this.inputEditor.setModel(textModel);
|
|
1540
|
-
if (this.configurationService.getValue("editor.wordBasedSuggestions", {
|
|
1541
|
-
resource: textModel.uri
|
|
1542
|
-
}) !== "off") {
|
|
1543
|
-
this.configurationService.updateValue("editor.wordBasedSuggestions", "off", {
|
|
1544
|
-
resource: textModel.uri
|
|
1545
|
-
}, ConfigurationTarget.MEMORY);
|
|
1546
|
-
}
|
|
1547
|
-
const validationDelayer = ( new ThrottledDelayer(200));
|
|
1548
|
-
const validate = async () => {
|
|
1549
|
-
const position = this.inputEditor.getSelection()?.getStartPosition();
|
|
1550
|
-
const offset = position && textModel.getOffsetAt(position);
|
|
1551
|
-
const value = textModel.getValue();
|
|
1552
|
-
this.setValidation(await input.validateInput(value, offset || 0));
|
|
1553
|
-
};
|
|
1554
|
-
const triggerValidation = () => validationDelayer.trigger(validate);
|
|
1555
|
-
this.repositoryDisposables.add(validationDelayer);
|
|
1556
|
-
this.repositoryDisposables.add(this.inputEditor.onDidChangeCursorPosition(triggerValidation));
|
|
1557
|
-
const opts = this.modelService.getCreationOptions(textModel.getLanguageId(), textModel.uri, textModel.isForSimpleWidget);
|
|
1558
|
-
const onEnter = Event.filter(
|
|
1559
|
-
this.inputEditor.onKeyDown,
|
|
1560
|
-
e => e.keyCode === KeyCode.Enter,
|
|
1561
|
-
this.repositoryDisposables
|
|
1562
|
-
);
|
|
1563
|
-
this.repositoryDisposables.add(
|
|
1564
|
-
onEnter(() => textModel.detectIndentation(opts.insertSpaces, opts.tabSize))
|
|
1565
|
-
);
|
|
1566
|
-
textModel.setValue(input.value);
|
|
1567
|
-
this.repositoryDisposables.add(input.onDidChange((
|
|
1568
|
-
{
|
|
1569
|
-
value,
|
|
1570
|
-
reason
|
|
1571
|
-
}
|
|
1572
|
-
) => {
|
|
1573
|
-
const currentValue = textModel.getValue();
|
|
1574
|
-
if (value === currentValue) {
|
|
1575
|
-
return;
|
|
1576
|
-
}
|
|
1577
|
-
textModel.pushStackElement();
|
|
1578
|
-
textModel.pushEditOperations(
|
|
1579
|
-
null,
|
|
1580
|
-
[EditOperation.replaceMove(textModel.getFullModelRange(), value)],
|
|
1581
|
-
() => []
|
|
1582
|
-
);
|
|
1583
|
-
const position = reason === SCMInputChangeReason.HistoryPrevious ? textModel.getFullModelRange().getStartPosition() : textModel.getFullModelRange().getEndPosition();
|
|
1584
|
-
this.inputEditor.setPosition(position);
|
|
1585
|
-
this.inputEditor.revealPositionInCenterIfOutsideViewport(position);
|
|
1586
|
-
}));
|
|
1587
|
-
this.repositoryDisposables.add(input.onDidChangeFocus(() => this.focus()));
|
|
1588
|
-
this.repositoryDisposables.add(input.onDidChangeValidationMessage(e => this.setValidation(e, {
|
|
1589
|
-
focus: true,
|
|
1590
|
-
timeout: true
|
|
1591
|
-
})));
|
|
1592
|
-
this.repositoryDisposables.add(input.onDidChangeValidateInput(e => triggerValidation()));
|
|
1593
|
-
this.repositoryDisposables.add(input.onDidClearValidation(() => this.clearValidation()));
|
|
1594
|
-
this.repositoryDisposables.add(textModel.onDidChangeContent(() => {
|
|
1595
|
-
input.setValue(textModel.getValue(), true);
|
|
1596
|
-
triggerValidation();
|
|
1597
|
-
}));
|
|
1598
|
-
const accessibilityVerbosityConfig = observableConfigValue(
|
|
1599
|
-
AccessibilityVerbositySettingId.SourceControl,
|
|
1600
|
-
true,
|
|
1601
|
-
this.configurationService
|
|
1602
|
-
);
|
|
1603
|
-
const getAriaLabel = (placeholder, verbosity) => {
|
|
1604
|
-
verbosity = verbosity ?? accessibilityVerbosityConfig.get();
|
|
1605
|
-
if (!verbosity || !this.accessibilityService.isScreenReaderOptimized()) {
|
|
1606
|
-
return placeholder;
|
|
1607
|
-
}
|
|
1608
|
-
const kbLabel = this.keybindingService.lookupKeybinding(AccessibilityCommandId.OpenAccessibilityHelp)?.getLabel();
|
|
1609
|
-
return kbLabel ? ( localize(
|
|
1610
|
-
11142,
|
|
1611
|
-
"{0}, Use {1} to open Source Control Accessibility Help.",
|
|
1612
|
-
placeholder,
|
|
1613
|
-
kbLabel
|
|
1614
|
-
)) : ( localize(
|
|
1615
|
-
11143,
|
|
1616
|
-
"{0}, Run the Open Accessibility Help command for more information.",
|
|
1617
|
-
placeholder
|
|
1618
|
-
));
|
|
1619
|
-
};
|
|
1620
|
-
const getPlaceholderText = () => {
|
|
1621
|
-
const binding = this.keybindingService.lookupKeybinding("scm.acceptInput");
|
|
1622
|
-
const label = binding ? binding.getLabel() : (isMacintosh ? "Cmd+Enter" : "Ctrl+Enter");
|
|
1623
|
-
return format(input.placeholder, label);
|
|
1624
|
-
};
|
|
1625
|
-
const updatePlaceholderText = () => {
|
|
1626
|
-
const placeholder = getPlaceholderText();
|
|
1627
|
-
const ariaLabel = getAriaLabel(placeholder);
|
|
1628
|
-
this.inputEditor.updateOptions({
|
|
1629
|
-
ariaLabel,
|
|
1630
|
-
placeholder
|
|
1631
|
-
});
|
|
1632
|
-
};
|
|
1633
|
-
this.repositoryDisposables.add(input.onDidChangePlaceholder(updatePlaceholderText));
|
|
1634
|
-
this.repositoryDisposables.add(this.keybindingService.onDidUpdateKeybindings(updatePlaceholderText));
|
|
1635
|
-
this.repositoryDisposables.add(runOnChange(accessibilityVerbosityConfig, verbosity => {
|
|
1636
|
-
const placeholder = getPlaceholderText();
|
|
1637
|
-
const ariaLabel = getAriaLabel(placeholder, verbosity);
|
|
1638
|
-
this.inputEditor.updateOptions({
|
|
1639
|
-
ariaLabel
|
|
1640
|
-
});
|
|
1641
|
-
}));
|
|
1642
|
-
updatePlaceholderText();
|
|
1643
|
-
let commitTemplate = "";
|
|
1644
|
-
this.repositoryDisposables.add(autorun(reader => {
|
|
1645
|
-
if (!input.visible) {
|
|
1646
|
-
return;
|
|
1647
|
-
}
|
|
1648
|
-
const oldCommitTemplate = commitTemplate;
|
|
1649
|
-
commitTemplate = input.repository.provider.commitTemplate.read(reader);
|
|
1650
|
-
const value = textModel.getValue();
|
|
1651
|
-
if (value && value !== oldCommitTemplate) {
|
|
1652
|
-
return;
|
|
1653
|
-
}
|
|
1654
|
-
textModel.setValue(commitTemplate);
|
|
1655
|
-
}));
|
|
1656
|
-
const updateEnablement = enabled => {
|
|
1657
|
-
this.inputEditor.updateOptions({
|
|
1658
|
-
readOnly: !enabled
|
|
1659
|
-
});
|
|
1660
|
-
};
|
|
1661
|
-
this.repositoryDisposables.add(input.onDidChangeEnablement(enabled => updateEnablement(enabled)));
|
|
1662
|
-
updateEnablement(input.enabled);
|
|
1663
|
-
this.toolbar.setInput(input);
|
|
1664
|
-
this.model = {
|
|
1665
|
-
input,
|
|
1666
|
-
textModel
|
|
1667
|
-
};
|
|
1668
|
-
}
|
|
1669
|
-
get selections() {
|
|
1670
|
-
return this.inputEditor.getSelections();
|
|
1671
|
-
}
|
|
1672
|
-
set selections(selections) {
|
|
1673
|
-
if (selections) {
|
|
1674
|
-
this.inputEditor.setSelections(selections);
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
setValidation(validation, options) {
|
|
1678
|
-
if (this._validationTimer) {
|
|
1679
|
-
clearTimeout(this._validationTimer);
|
|
1680
|
-
this._validationTimer = undefined;
|
|
1681
|
-
}
|
|
1682
|
-
this.validation = validation;
|
|
1683
|
-
this.renderValidation();
|
|
1684
|
-
if (options?.focus && !this.hasFocus()) {
|
|
1685
|
-
this.focus();
|
|
1686
|
-
}
|
|
1687
|
-
if (validation && options?.timeout) {
|
|
1688
|
-
this._validationTimer = setTimeout(
|
|
1689
|
-
() => this.setValidation(undefined),
|
|
1690
|
-
SCMInputWidget_1.ValidationTimeouts[validation.type]
|
|
1691
|
-
);
|
|
1692
|
-
}
|
|
1693
|
-
}
|
|
1694
|
-
constructor(
|
|
1695
|
-
container,
|
|
1696
|
-
overflowWidgetsDomNode,
|
|
1697
|
-
contextKeyService,
|
|
1698
|
-
instantiationService,
|
|
1699
|
-
modelService,
|
|
1700
|
-
keybindingService,
|
|
1701
|
-
configurationService,
|
|
1702
|
-
scmViewService,
|
|
1703
|
-
contextViewService,
|
|
1704
|
-
openerService,
|
|
1705
|
-
accessibilityService,
|
|
1706
|
-
markdownRendererService
|
|
1707
|
-
) {
|
|
1708
|
-
this.modelService = modelService;
|
|
1709
|
-
this.keybindingService = keybindingService;
|
|
1710
|
-
this.configurationService = configurationService;
|
|
1711
|
-
this.scmViewService = scmViewService;
|
|
1712
|
-
this.contextViewService = contextViewService;
|
|
1713
|
-
this.openerService = openerService;
|
|
1714
|
-
this.accessibilityService = accessibilityService;
|
|
1715
|
-
this.markdownRendererService = markdownRendererService;
|
|
1716
|
-
this.disposables = ( new DisposableStore());
|
|
1717
|
-
this.repositoryDisposables = ( new DisposableStore());
|
|
1718
|
-
this.validationHasFocus = false;
|
|
1719
|
-
this.lastLayoutWasTrash = false;
|
|
1720
|
-
this.shouldFocusAfterLayout = false;
|
|
1721
|
-
this.element = append(container, $(".scm-editor"));
|
|
1722
|
-
this.editorContainer = append(this.element, $(".scm-editor-container"));
|
|
1723
|
-
this.toolbarContainer = append(this.element, $(".scm-editor-toolbar"));
|
|
1724
|
-
this.contextKeyService = contextKeyService.createScoped(this.element);
|
|
1725
|
-
this.repositoryIdContextKey = this.contextKeyService.createKey("scmRepository", undefined);
|
|
1726
|
-
this.validationMessageContextKey = ContextKeys.SCMInputHasValidationMessage.bindTo(this.contextKeyService);
|
|
1727
|
-
this.inputEditorOptions = ( new SCMInputWidgetEditorOptions(overflowWidgetsDomNode, this.configurationService));
|
|
1728
|
-
this.disposables.add(this.inputEditorOptions.onDidChange(this.onDidChangeEditorOptions, this));
|
|
1729
|
-
this.disposables.add(this.inputEditorOptions);
|
|
1730
|
-
const codeEditorWidgetOptions = {
|
|
1731
|
-
contributions: EditorExtensionsRegistry.getSomeEditorContributions([
|
|
1732
|
-
CodeActionController.ID,
|
|
1733
|
-
ColorDetector.ID,
|
|
1734
|
-
ContextMenuController.ID,
|
|
1735
|
-
CopyPasteController.ID,
|
|
1736
|
-
DragAndDropController.ID,
|
|
1737
|
-
DropIntoEditorController.ID,
|
|
1738
|
-
EditorDictation.ID,
|
|
1739
|
-
FormatOnType.ID,
|
|
1740
|
-
ContentHoverController.ID,
|
|
1741
|
-
GlyphHoverController.ID,
|
|
1742
|
-
InlineCompletionsController.ID,
|
|
1743
|
-
LinkDetector.ID,
|
|
1744
|
-
MenuPreventer.ID,
|
|
1745
|
-
MessageController.ID,
|
|
1746
|
-
PlaceholderTextContribution.ID,
|
|
1747
|
-
SelectionClipboardContributionID,
|
|
1748
|
-
SnippetController2.ID,
|
|
1749
|
-
SuggestController.ID
|
|
1750
|
-
]),
|
|
1751
|
-
isSimpleWidget: true
|
|
1752
|
-
};
|
|
1753
|
-
const services = ( new ServiceCollection([IContextKeyService, this.contextKeyService]));
|
|
1754
|
-
const instantiationService2 = instantiationService.createChild(services, this.disposables);
|
|
1755
|
-
const editorConstructionOptions = this.inputEditorOptions.getEditorConstructionOptions();
|
|
1756
|
-
this.inputEditor = instantiationService2.createInstance(
|
|
1757
|
-
CodeEditorWidget,
|
|
1758
|
-
this.editorContainer,
|
|
1759
|
-
editorConstructionOptions,
|
|
1760
|
-
codeEditorWidgetOptions
|
|
1761
|
-
);
|
|
1762
|
-
this.disposables.add(this.inputEditor);
|
|
1763
|
-
this.disposables.add(this.inputEditor.onDidFocusEditorText(() => {
|
|
1764
|
-
if (this.input?.repository) {
|
|
1765
|
-
this.scmViewService.focus(this.input.repository);
|
|
1766
|
-
}
|
|
1767
|
-
this.element.classList.add("synthetic-focus");
|
|
1768
|
-
this.renderValidation();
|
|
1769
|
-
}));
|
|
1770
|
-
this.disposables.add(this.inputEditor.onDidBlurEditorText(() => {
|
|
1771
|
-
this.element.classList.remove("synthetic-focus");
|
|
1772
|
-
setTimeout(() => {
|
|
1773
|
-
if (!this.validation || !this.validationHasFocus) {
|
|
1774
|
-
this.clearValidation();
|
|
1775
|
-
}
|
|
1776
|
-
}, 0);
|
|
1777
|
-
}));
|
|
1778
|
-
this.disposables.add(this.inputEditor.onDidBlurEditorWidget(() => {
|
|
1779
|
-
CopyPasteController.get(this.inputEditor)?.clearWidgets();
|
|
1780
|
-
DropIntoEditorController.get(this.inputEditor)?.clearWidgets();
|
|
1781
|
-
}));
|
|
1782
|
-
const firstLineKey = this.contextKeyService.createKey("scmInputIsInFirstPosition", false);
|
|
1783
|
-
const lastLineKey = this.contextKeyService.createKey("scmInputIsInLastPosition", false);
|
|
1784
|
-
this.disposables.add(this.inputEditor.onDidChangeCursorPosition((
|
|
1785
|
-
{
|
|
1786
|
-
position
|
|
1787
|
-
}
|
|
1788
|
-
) => {
|
|
1789
|
-
const viewModel = this.inputEditor._getViewModel();
|
|
1790
|
-
const lastLineNumber = viewModel.getLineCount();
|
|
1791
|
-
const lastLineCol = viewModel.getLineLength(lastLineNumber) + 1;
|
|
1792
|
-
const viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(position);
|
|
1793
|
-
firstLineKey.set(viewPosition.lineNumber === 1 && viewPosition.column === 1);
|
|
1794
|
-
lastLineKey.set(
|
|
1795
|
-
viewPosition.lineNumber === lastLineNumber && viewPosition.column === lastLineCol
|
|
1796
|
-
);
|
|
1797
|
-
}));
|
|
1798
|
-
this.disposables.add(this.inputEditor.onDidScrollChange(e => {
|
|
1799
|
-
this.toolbarContainer.classList.toggle("scroll-decoration", e.scrollTop > 0);
|
|
1800
|
-
}));
|
|
1801
|
-
Event.filter(
|
|
1802
|
-
this.configurationService.onDidChangeConfiguration,
|
|
1803
|
-
e => e.affectsConfiguration("scm.showInputActionButton")
|
|
1804
|
-
)(() => this.layout(), this, this.disposables);
|
|
1805
|
-
this.onDidChangeContentHeight = Event.signal(Event.filter(
|
|
1806
|
-
this.inputEditor.onDidContentSizeChange,
|
|
1807
|
-
e => e.contentHeightChanged,
|
|
1808
|
-
this.disposables
|
|
1809
|
-
));
|
|
1810
|
-
this.toolbar = instantiationService2.createInstance(SCMInputWidgetToolbar, this.toolbarContainer, {
|
|
1811
|
-
actionViewItemProvider: (action, options) => {
|
|
1812
|
-
if (action instanceof MenuItemAction && this.toolbar.dropdownActions.length > 1) {
|
|
1813
|
-
return instantiationService.createInstance(
|
|
1814
|
-
DropdownWithPrimaryActionViewItem,
|
|
1815
|
-
action,
|
|
1816
|
-
this.toolbar.dropdownAction,
|
|
1817
|
-
this.toolbar.dropdownActions,
|
|
1818
|
-
"",
|
|
1819
|
-
{
|
|
1820
|
-
actionRunner: this.toolbar.actionRunner,
|
|
1821
|
-
hoverDelegate: options.hoverDelegate
|
|
1822
|
-
}
|
|
1823
|
-
);
|
|
1824
|
-
}
|
|
1825
|
-
return createActionViewItem(instantiationService, action, options);
|
|
1826
|
-
},
|
|
1827
|
-
hiddenItemStrategy: HiddenItemStrategy.NoHide,
|
|
1828
|
-
menuOptions: {
|
|
1829
|
-
shouldForwardArgs: true
|
|
1830
|
-
}
|
|
1831
|
-
});
|
|
1832
|
-
this.disposables.add(this.toolbar.onDidChange(() => this.layout()));
|
|
1833
|
-
this.disposables.add(this.toolbar);
|
|
1834
|
-
}
|
|
1835
|
-
getContentHeight() {
|
|
1836
|
-
const lineHeight = this.inputEditor.getOption(EditorOption.lineHeight);
|
|
1837
|
-
const {
|
|
1838
|
-
top,
|
|
1839
|
-
bottom
|
|
1840
|
-
} = this.inputEditor.getOption(EditorOption.padding);
|
|
1841
|
-
const inputMinLinesConfig = this.configurationService.getValue("scm.inputMinLineCount");
|
|
1842
|
-
const inputMinLines = typeof inputMinLinesConfig === "number" ? clamp(inputMinLinesConfig, 1, 50) : 1;
|
|
1843
|
-
const editorMinHeight = inputMinLines * lineHeight + top + bottom;
|
|
1844
|
-
const inputMaxLinesConfig = this.configurationService.getValue("scm.inputMaxLineCount");
|
|
1845
|
-
const inputMaxLines = typeof inputMaxLinesConfig === "number" ? clamp(inputMaxLinesConfig, 1, 50) : 10;
|
|
1846
|
-
const editorMaxHeight = inputMaxLines * lineHeight + top + bottom;
|
|
1847
|
-
return clamp(this.inputEditor.getContentHeight(), editorMinHeight, editorMaxHeight);
|
|
1848
|
-
}
|
|
1849
|
-
layout() {
|
|
1850
|
-
const editorHeight = this.getContentHeight();
|
|
1851
|
-
const toolbarWidth = this.getToolbarWidth();
|
|
1852
|
-
const dimension = ( new Dimension(this.element.clientWidth - toolbarWidth, editorHeight));
|
|
1853
|
-
if (dimension.width < 0) {
|
|
1854
|
-
this.lastLayoutWasTrash = true;
|
|
1855
|
-
return;
|
|
1856
|
-
}
|
|
1857
|
-
this.lastLayoutWasTrash = false;
|
|
1858
|
-
this.inputEditor.layout(dimension);
|
|
1859
|
-
this.renderValidation();
|
|
1860
|
-
const showInputActionButton = this.configurationService.getValue("scm.showInputActionButton") === true;
|
|
1861
|
-
this.toolbarContainer.classList.toggle("hidden", !showInputActionButton || this.toolbar?.isEmpty() === true);
|
|
1862
|
-
if (this.shouldFocusAfterLayout) {
|
|
1863
|
-
this.shouldFocusAfterLayout = false;
|
|
1864
|
-
this.focus();
|
|
1865
|
-
}
|
|
1866
|
-
}
|
|
1867
|
-
focus() {
|
|
1868
|
-
if (this.lastLayoutWasTrash) {
|
|
1869
|
-
this.lastLayoutWasTrash = false;
|
|
1870
|
-
this.shouldFocusAfterLayout = true;
|
|
1871
|
-
return;
|
|
1872
|
-
}
|
|
1873
|
-
this.inputEditor.focus();
|
|
1874
|
-
this.element.classList.add("synthetic-focus");
|
|
1875
|
-
}
|
|
1876
|
-
hasFocus() {
|
|
1877
|
-
return this.inputEditor.hasTextFocus();
|
|
1878
|
-
}
|
|
1879
|
-
onDidChangeEditorOptions() {
|
|
1880
|
-
this.inputEditor.updateOptions(this.inputEditorOptions.getEditorOptions());
|
|
1881
|
-
}
|
|
1882
|
-
renderValidation() {
|
|
1883
|
-
this.clearValidation();
|
|
1884
|
-
this.element.classList.toggle(
|
|
1885
|
-
"validation-info",
|
|
1886
|
-
this.validation?.type === InputValidationType.Information
|
|
1887
|
-
);
|
|
1888
|
-
this.element.classList.toggle(
|
|
1889
|
-
"validation-warning",
|
|
1890
|
-
this.validation?.type === InputValidationType.Warning
|
|
1891
|
-
);
|
|
1892
|
-
this.element.classList.toggle("validation-error", this.validation?.type === InputValidationType.Error);
|
|
1893
|
-
if (!this.validation || !this.inputEditor.hasTextFocus()) {
|
|
1894
|
-
return;
|
|
1895
|
-
}
|
|
1896
|
-
this.validationMessageContextKey.set(true);
|
|
1897
|
-
const disposables = ( new DisposableStore());
|
|
1898
|
-
this.validationContextView = this.contextViewService.showContextView({
|
|
1899
|
-
getAnchor: () => this.element,
|
|
1900
|
-
render: container => {
|
|
1901
|
-
this.element.style.borderBottomLeftRadius = "0";
|
|
1902
|
-
this.element.style.borderBottomRightRadius = "0";
|
|
1903
|
-
const validationContainer = append(container, $(".scm-editor-validation-container"));
|
|
1904
|
-
validationContainer.classList.toggle(
|
|
1905
|
-
"validation-info",
|
|
1906
|
-
this.validation.type === InputValidationType.Information
|
|
1907
|
-
);
|
|
1908
|
-
validationContainer.classList.toggle("validation-warning", this.validation.type === InputValidationType.Warning);
|
|
1909
|
-
validationContainer.classList.toggle("validation-error", this.validation.type === InputValidationType.Error);
|
|
1910
|
-
validationContainer.style.width = `${this.element.clientWidth + 2}px`;
|
|
1911
|
-
const element = append(validationContainer, $(".scm-editor-validation"));
|
|
1912
|
-
const message = this.validation.message;
|
|
1913
|
-
if (typeof message === "string") {
|
|
1914
|
-
element.textContent = message;
|
|
1915
|
-
} else {
|
|
1916
|
-
const tracker = trackFocus(element);
|
|
1917
|
-
disposables.add(tracker);
|
|
1918
|
-
disposables.add(tracker.onDidFocus(() => (this.validationHasFocus = true)));
|
|
1919
|
-
disposables.add(tracker.onDidBlur(() => {
|
|
1920
|
-
this.validationHasFocus = false;
|
|
1921
|
-
this.element.style.borderBottomLeftRadius = "2px";
|
|
1922
|
-
this.element.style.borderBottomRightRadius = "2px";
|
|
1923
|
-
this.contextViewService.hideContextView();
|
|
1924
|
-
}));
|
|
1925
|
-
const renderedMarkdown = this.markdownRendererService.render(message, {
|
|
1926
|
-
actionHandler: (link, mdStr) => {
|
|
1927
|
-
openLinkFromMarkdown(this.openerService, link, mdStr.isTrusted);
|
|
1928
|
-
this.element.style.borderBottomLeftRadius = "2px";
|
|
1929
|
-
this.element.style.borderBottomRightRadius = "2px";
|
|
1930
|
-
this.contextViewService.hideContextView();
|
|
1931
|
-
}
|
|
1932
|
-
});
|
|
1933
|
-
disposables.add(renderedMarkdown);
|
|
1934
|
-
element.appendChild(renderedMarkdown.element);
|
|
1935
|
-
}
|
|
1936
|
-
const actionsContainer = append(validationContainer, $(".scm-editor-validation-actions"));
|
|
1937
|
-
const actionbar = ( new ActionBar(actionsContainer));
|
|
1938
|
-
const action = ( new Action("scmInputWidget.validationMessage.close", ( localize(11144, "Close")), ThemeIcon.asClassName(Codicon.close), true, () => {
|
|
1939
|
-
this.contextViewService.hideContextView();
|
|
1940
|
-
this.element.style.borderBottomLeftRadius = "2px";
|
|
1941
|
-
this.element.style.borderBottomRightRadius = "2px";
|
|
1942
|
-
}));
|
|
1943
|
-
disposables.add(actionbar);
|
|
1944
|
-
actionbar.push(action, {
|
|
1945
|
-
icon: true,
|
|
1946
|
-
label: false
|
|
1947
|
-
});
|
|
1948
|
-
return Disposable.None;
|
|
1949
|
-
},
|
|
1950
|
-
onHide: () => {
|
|
1951
|
-
this.validationHasFocus = false;
|
|
1952
|
-
this.element.style.borderBottomLeftRadius = "2px";
|
|
1953
|
-
this.element.style.borderBottomRightRadius = "2px";
|
|
1954
|
-
disposables.dispose();
|
|
1955
|
-
},
|
|
1956
|
-
anchorAlignment: AnchorAlignment.LEFT
|
|
1957
|
-
});
|
|
1958
|
-
}
|
|
1959
|
-
getToolbarWidth() {
|
|
1960
|
-
const showInputActionButton = this.configurationService.getValue("scm.showInputActionButton");
|
|
1961
|
-
if (!this.toolbar || !showInputActionButton || this.toolbar?.isEmpty() === true) {
|
|
1962
|
-
return 0;
|
|
1963
|
-
}
|
|
1964
|
-
return this.toolbar.dropdownActions.length === 0 ? 26 : 39 ;
|
|
1965
|
-
}
|
|
1966
|
-
clearValidation() {
|
|
1967
|
-
this.validationContextView?.close();
|
|
1968
|
-
this.validationContextView = undefined;
|
|
1969
|
-
this.validationHasFocus = false;
|
|
1970
|
-
this.validationMessageContextKey.set(false);
|
|
1971
|
-
}
|
|
1972
|
-
dispose() {
|
|
1973
|
-
this.input = undefined;
|
|
1974
|
-
this.repositoryDisposables.dispose();
|
|
1975
|
-
this.clearValidation();
|
|
1976
|
-
this.disposables.dispose();
|
|
1977
|
-
}
|
|
1978
|
-
};
|
|
1979
|
-
SCMInputWidget = SCMInputWidget_1 = ( __decorate([( __param(2, IContextKeyService)), ( __param(3, IInstantiationService)), ( __param(4, IModelService)), ( __param(5, IKeybindingService)), ( __param(6, IConfigurationService)), ( __param(7, ISCMViewService)), ( __param(8, IContextViewService)), ( __param(9, IOpenerService)), ( __param(10, IAccessibilityService)), ( __param(11, IMarkdownRendererService))], SCMInputWidget));
|
|
1980
1200
|
let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
1981
1201
|
get viewMode() {
|
|
1982
1202
|
return this._viewMode;
|
|
@@ -2039,9 +1259,9 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2039
1259
|
this.scmViewService = scmViewService;
|
|
2040
1260
|
this.storageService = storageService;
|
|
2041
1261
|
this.uriIdentityService = uriIdentityService;
|
|
2042
|
-
this._onDidChangeViewMode = ( new Emitter());
|
|
1262
|
+
this._onDidChangeViewMode = this._register(( new Emitter()));
|
|
2043
1263
|
this.onDidChangeViewMode = this._onDidChangeViewMode.event;
|
|
2044
|
-
this._onDidChangeViewSortKey = ( new Emitter());
|
|
1264
|
+
this._onDidChangeViewSortKey = this._register(( new Emitter()));
|
|
2045
1265
|
this.onDidChangeViewSortKey = this._onDidChangeViewSortKey.event;
|
|
2046
1266
|
this.items = ( new DisposableMap());
|
|
2047
1267
|
this.visibilityDisposables = ( new DisposableStore());
|
|
@@ -2060,7 +1280,7 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2060
1280
|
this.scmProviderContextKey = ContextKeys.SCMProvider.bindTo(contextKeyService);
|
|
2061
1281
|
this.scmProviderRootUriContextKey = ContextKeys.SCMProviderRootUri.bindTo(contextKeyService);
|
|
2062
1282
|
this.scmProviderHasRootUriContextKey = ContextKeys.SCMProviderHasRootUri.bindTo(contextKeyService);
|
|
2063
|
-
this._onDidLayout = ( new Emitter());
|
|
1283
|
+
this._onDidLayout = this._register(( new Emitter()));
|
|
2064
1284
|
this.layoutCache = {
|
|
2065
1285
|
height: undefined,
|
|
2066
1286
|
width: undefined,
|
|
@@ -2698,6 +1918,8 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2698
1918
|
});
|
|
2699
1919
|
}
|
|
2700
1920
|
dispose() {
|
|
1921
|
+
this._onDidChangeViewMode.dispose();
|
|
1922
|
+
this._onDidChangeViewSortKey.dispose();
|
|
2701
1923
|
this.visibilityDisposables.dispose();
|
|
2702
1924
|
this.disposables.dispose();
|
|
2703
1925
|
this.items.dispose();
|
|
@@ -2895,6 +2117,5 @@ class SCMActionButton {
|
|
|
2895
2117
|
}
|
|
2896
2118
|
}
|
|
2897
2119
|
}
|
|
2898
|
-
setupSimpleEditorSelectionStyling(".scm-view .scm-editor-container");
|
|
2899
2120
|
|
|
2900
2121
|
export { ActionButtonRenderer, ContextKeys, SCMAccessibilityProvider, SCMActionButton, SCMTreeKeyboardNavigationLabelProvider, SCMTreeSorter, SCMViewPane };
|