[main]: Update list support find context key name (#156905)

Fix #156878. Update list support find context key name

Co-authored-by: Connor Peet <connor@peet.io>
This commit is contained in:
Peng Lyu
2022-08-02 10:19:20 -07:00
committed by GitHub
co-authored by Connor Peet
parent 2842ae2481
commit 2bdfa39fab
2 changed files with 7 additions and 6 deletions
+5 -4
View File
@@ -120,12 +120,12 @@ export const WorkbenchListHasSelectionOrFocus = new RawContextKey<boolean>('list
export const WorkbenchListDoubleSelection = new RawContextKey<boolean>('listDoubleSelection', false);
export const WorkbenchListMultiSelection = new RawContextKey<boolean>('listMultiSelection', false);
export const WorkbenchListSelectionNavigation = new RawContextKey<boolean>('listSelectionNavigation', false);
export const WorkbenchListSupportsFind = new RawContextKey<boolean>('listSupportsFind', true);
export const WorkbenchTreeElementCanCollapse = new RawContextKey<boolean>('treeElementCanCollapse', false);
export const WorkbenchTreeElementHasParent = new RawContextKey<boolean>('treeElementHasParent', false);
export const WorkbenchTreeElementCanExpand = new RawContextKey<boolean>('treeElementCanExpand', false);
export const WorkbenchTreeElementHasChild = new RawContextKey<boolean>('treeElementHasChild', false);
export const WorkbenchTreeFindOpen = new RawContextKey<boolean>('treeFindOpen', false);
export const WorkbenchTreeSupportsFind = new RawContextKey<boolean>('treeSupportsFind', true);
const WorkbenchListTypeNavigationModeKey = 'listTypeNavigationMode';
/**
@@ -1136,6 +1136,7 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
readonly contextKeyService: IContextKeyService;
private listSupportsMultiSelect: IContextKey<boolean>;
private listSupportFindWidget: IContextKey<boolean>;
private hasSelectionOrFocus: IContextKey<boolean>;
private hasDoubleSelection: IContextKey<boolean>;
private hasMultiSelection: IContextKey<boolean>;
@@ -1144,7 +1145,6 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
private treeElementCanExpand: IContextKey<boolean>;
private treeElementHasChild: IContextKey<boolean>;
private treeFindOpen: IContextKey<boolean>;
private treeSupportFindWidget: IContextKey<boolean>;
private _useAltAsMultipleSelectionModifier: boolean;
private disposables: IDisposable[] = [];
private styler: IDisposable | undefined;
@@ -1170,6 +1170,9 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
const listSelectionNavigation = WorkbenchListSelectionNavigation.bindTo(this.contextKeyService);
listSelectionNavigation.set(Boolean(options.selectionNavigation));
this.listSupportFindWidget = WorkbenchListSupportsFind.bindTo(this.contextKeyService);
this.listSupportFindWidget.set(options.findWidgetEnabled ?? true);
this.hasSelectionOrFocus = WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService);
this.hasDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService);
this.hasMultiSelection = WorkbenchListMultiSelection.bindTo(this.contextKeyService);
@@ -1180,8 +1183,6 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
this.treeElementHasChild = WorkbenchTreeElementHasChild.bindTo(this.contextKeyService);
this.treeFindOpen = WorkbenchTreeFindOpen.bindTo(this.contextKeyService);
this.treeSupportFindWidget = WorkbenchTreeSupportsFind.bindTo(this.contextKeyService);
this.treeSupportFindWidget.set(options.findWidgetEnabled ?? true);
this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);
@@ -7,7 +7,7 @@ import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { List } from 'vs/base/browser/ui/list/listWidget';
import { WorkbenchListFocusContextKey, IListService, WorkbenchListSupportsMultiSelectContextKey, ListWidget, WorkbenchListHasSelectionOrFocus, getSelectionKeyboardEvent, WorkbenchListWidget, WorkbenchListSelectionNavigation, WorkbenchTreeElementCanCollapse, WorkbenchTreeElementHasParent, WorkbenchTreeElementHasChild, WorkbenchTreeElementCanExpand, RawWorkbenchListFocusContextKey, WorkbenchTreeFindOpen, WorkbenchTreeSupportsFind } from 'vs/platform/list/browser/listService';
import { WorkbenchListFocusContextKey, IListService, WorkbenchListSupportsMultiSelectContextKey, ListWidget, WorkbenchListHasSelectionOrFocus, getSelectionKeyboardEvent, WorkbenchListWidget, WorkbenchListSelectionNavigation, WorkbenchTreeElementCanCollapse, WorkbenchTreeElementHasParent, WorkbenchTreeElementHasChild, WorkbenchTreeElementCanExpand, RawWorkbenchListFocusContextKey, WorkbenchTreeFindOpen, WorkbenchListSupportsFind } from 'vs/platform/list/browser/listService';
import { PagedList } from 'vs/base/browser/ui/list/listPaging';
import { equals, range } from 'vs/base/common/arrays';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
@@ -634,7 +634,7 @@ CommandsRegistry.registerCommandAlias('list.toggleFilterOnType', 'list.toggleFin
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'list.find',
weight: KeybindingWeight.WorkbenchContrib,
when: ContextKeyExpr.and(RawWorkbenchListFocusContextKey, WorkbenchTreeSupportsFind),
when: ContextKeyExpr.and(RawWorkbenchListFocusContextKey, WorkbenchListSupportsFind),
primary: KeyMod.CtrlCmd | KeyCode.KeyF,
secondary: [KeyCode.F3],
handler: (accessor) => {