Skip to content

Commit 11cc162

Browse files
authored
SCM - 💄 code cleanup (microsoft#200977)
1 parent a5698e8 commit 11cc162

File tree

1 file changed

+12
-28
lines changed

1 file changed

+12
-28
lines changed

src/vs/workbench/contrib/scm/browser/scmViewPane.ts

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,12 +1060,8 @@ class SCMTreeCompressionDelegate implements ITreeCompressionDelegate<TreeElement
10601060
class SCMTreeFilter implements ITreeFilter<TreeElement> {
10611061

10621062
filter(element: TreeElement): boolean {
1063-
if (ResourceTree.isResourceNode(element)) {
1064-
return true;
1065-
} else if (isSCMResourceGroup(element)) {
1063+
if (isSCMResourceGroup(element)) {
10661064
return element.resources.length > 0 || !element.hideWhenEmpty;
1067-
} else if (isSCMViewSeparator(element)) {
1068-
return true;
10691065
} else {
10701066
return true;
10711067
}
@@ -3249,30 +3245,18 @@ class SCMTreeDataSource implements IAsyncDataSource<ISCMViewService, TreeElement
32493245

32503246
// Incoming/Outgoing Separator
32513247
if (historyItemGroups.length > 0) {
3252-
const showIncomingChanges = this.showIncomingChanges();
3253-
const showOutgoingChanges = this.showOutgoingChanges();
3254-
if (showIncomingChanges !== 'never' && showOutgoingChanges !== 'never') {
3255-
children.push({
3256-
label: localize('syncSeparatorHeader', "Incoming/Outgoing"),
3257-
ariaLabel: localize('syncSeparatorHeaderAriaLabel', "Incoming and outgoing changes"),
3258-
repository: inputOrElement,
3259-
type: 'separator'
3260-
} as SCMViewSeparatorElement);
3261-
} else if (showIncomingChanges === 'never') {
3262-
children.push({
3263-
label: localize('syncOutgoingSeparatorHeader', "Outgoing"),
3264-
ariaLabel: localize('syncOutgoingSeparatorHeaderAriaLabel', "Outgoing changes"),
3265-
repository: inputOrElement,
3266-
type: 'separator'
3267-
} as SCMViewSeparatorElement);
3268-
} else if (showOutgoingChanges === 'never') {
3269-
children.push({
3270-
label: localize('syncIncomingSeparatorHeader', "Incoming"),
3271-
ariaLabel: localize('syncIncomingSeparatorHeaderAriaLabel', "Incoming changes"),
3272-
repository: inputOrElement,
3273-
type: 'separator'
3274-
} as SCMViewSeparatorElement);
3248+
let label = localize('syncSeparatorHeader', "Incoming/Outgoing");
3249+
let ariaLabel = localize('syncSeparatorHeaderAriaLabel', "Incoming and outgoing changes");
3250+
3251+
if (this.showIncomingChanges() !== 'never' && this.showOutgoingChanges() === 'never') {
3252+
label = localize('syncIncomingSeparatorHeader', "Incoming");
3253+
ariaLabel = localize('syncIncomingSeparatorHeaderAriaLabel', "Incoming changes");
3254+
} else if (this.showIncomingChanges() === 'never' && this.showOutgoingChanges() !== 'never') {
3255+
label = localize('syncOutgoingSeparatorHeader', "Outgoing");
3256+
ariaLabel = localize('syncOutgoingSeparatorHeaderAriaLabel', "Outgoing changes");
32753257
}
3258+
3259+
children.push({ label, ariaLabel, repository: inputOrElement, type: 'separator' } as SCMViewSeparatorElement);
32763260
}
32773261

32783262
children.push(...historyItemGroups);

0 commit comments

Comments
 (0)