Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/vs/platform/list/browser/listService.ts')
-rw-r--r--src/vs/platform/list/browser/listService.ts187
1 files changed, 108 insertions, 79 deletions
diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts
index 2447e50aafe..eca74c211c7 100644
--- a/src/vs/platform/list/browser/listService.ts
+++ b/src/vs/platform/list/browser/listService.ts
@@ -4,12 +4,13 @@
*--------------------------------------------------------------------------------------------*/
import { createStyleSheet } from 'vs/base/browser/dom';
+import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';
import { IListMouseEvent, IListRenderer, IListTouchEvent, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
import { IPagedListOptions, IPagedRenderer, PagedList } from 'vs/base/browser/ui/list/listPaging';
-import { DefaultStyleController, IListAccessibilityProvider, IListOptions, IListOptionsUpdate, IMultipleSelectionController, isSelectionRangeChangeEvent, isSelectionSingleChangeEvent, List } from 'vs/base/browser/ui/list/listWidget';
+import { DefaultStyleController, IListAccessibilityProvider, IListOptions, IListOptionsUpdate, IMultipleSelectionController, isSelectionRangeChangeEvent, isSelectionSingleChangeEvent, List, TypeNavigationMode } from 'vs/base/browser/ui/list/listWidget';
import { ITableColumn, ITableRenderer, ITableVirtualDelegate } from 'vs/base/browser/ui/table/table';
import { ITableOptions, ITableOptionsUpdate, Table } from 'vs/base/browser/ui/table/tableWidget';
-import { IAbstractTreeOptions, IAbstractTreeOptionsUpdate, IKeyboardNavigationEventFilter, RenderIndentGuides } from 'vs/base/browser/ui/tree/abstractTree';
+import { TreeFindMode, IAbstractTreeOptions, IAbstractTreeOptionsUpdate, IKeyboardNavigationEventFilter, RenderIndentGuides } from 'vs/base/browser/ui/tree/abstractTree';
import { AsyncDataTree, CompressibleAsyncDataTree, IAsyncDataTreeOptions, IAsyncDataTreeOptionsUpdate, ICompressibleAsyncDataTreeOptions, ICompressibleAsyncDataTreeOptionsUpdate, ITreeCompressionDelegate } from 'vs/base/browser/ui/tree/asyncDataTree';
import { DataTree, IDataTreeOptions } from 'vs/base/browser/ui/tree/dataTree';
import { CompressibleObjectTree, ICompressibleObjectTreeOptions, ICompressibleObjectTreeOptionsUpdate, ICompressibleTreeRenderer, IObjectTreeOptions, ObjectTree } from 'vs/base/browser/ui/tree/objectTree';
@@ -17,13 +18,13 @@ import { IAsyncDataSource, IDataSource, ITreeEvent, ITreeRenderer } from 'vs/bas
import { Emitter, Event } from 'vs/base/common/event';
import { combinedDisposable, Disposable, DisposableStore, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { localize } from 'vs/nls';
-import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { Extensions as ConfigurationExtensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
import { ContextKeyExpr, IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { InputFocusedContextKey } from 'vs/platform/contextkey/common/contextkeys';
+import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IEditorOptions } from 'vs/platform/editor/common/editor';
-import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
+import { createDecorator, IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { Registry } from 'vs/platform/registry/common/platform';
import { attachListStyler, computeStyles, defaultListStyles, IColorMapping } from 'vs/platform/theme/common/styler';
@@ -112,7 +113,7 @@ export class ListService implements IListService {
}
}
-const RawWorkbenchListFocusContextKey = new RawContextKey<boolean>('listFocus', true);
+export const RawWorkbenchListFocusContextKey = new RawContextKey<boolean>('listFocus', true);
export const WorkbenchListSupportsMultiSelectContextKey = new RawContextKey<boolean>('listSupportsMultiselect', true);
export const WorkbenchListFocusContextKey = ContextKeyExpr.and(RawWorkbenchListFocusContextKey, ContextKeyExpr.not(InputFocusedContextKey));
export const WorkbenchListHasSelectionOrFocus = new RawContextKey<boolean>('listHasSelectionOrFocus', false);
@@ -123,7 +124,13 @@ export const WorkbenchTreeElementCanCollapse = new RawContextKey<boolean>('treeE
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 WorkbenchListAutomaticKeyboardNavigationKey = 'listAutomaticKeyboardNavigation';
+export const WorkbenchTreeFindOpen = new RawContextKey<boolean>('treeFindOpen', false);
+const WorkbenchListTypeNavigationModeKey = 'listTypeNavigationMode';
+
+/**
+ * @deprecated in favor of WorkbenchListTypeNavigationModeKey
+ */
+const WorkbenchListAutomaticKeyboardNavigationLegacyKey = 'listAutomaticKeyboardNavigation';
function createScopedContextKeyService(contextKeyService: IContextKeyService, widget: ListWidget): IContextKeyService {
const result = contextKeyService.createScoped(widget.getHTMLElement());
@@ -134,8 +141,9 @@ function createScopedContextKeyService(contextKeyService: IContextKeyService, wi
const multiSelectModifierSettingKey = 'workbench.list.multiSelectModifier';
const openModeSettingKey = 'workbench.list.openMode';
const horizontalScrollingKey = 'workbench.list.horizontalScrolling';
+const defaultFindModeSettingKey = 'workbench.list.defaultFindMode';
+/** @deprecated in favor of workbench.list.defaultFindMode */
const keyboardNavigationSettingKey = 'workbench.list.keyboardNavigation';
-const automaticKeyboardNavigationSettingKey = 'workbench.list.automaticKeyboardNavigation';
const treeIndentKey = 'workbench.tree.indent';
const treeRenderIndentGuidesKey = 'workbench.tree.renderIndentGuides';
const listSmoothScrolling = 'workbench.list.smoothScrolling';
@@ -840,17 +848,16 @@ export class WorkbenchObjectTree<T extends NonNullable<any>, TFilterData = void>
delegate: IListVirtualDelegate<T>,
renderers: ITreeRenderer<T, TFilterData, any>[],
options: IWorkbenchObjectTreeOptions<T, TFilterData>,
+ @IInstantiationService instantiationService: IInstantiationService,
@IContextKeyService contextKeyService: IContextKeyService,
@IListService listService: IListService,
@IThemeService themeService: IThemeService,
- @IConfigurationService configurationService: IConfigurationService,
- @IKeybindingService keybindingService: IKeybindingService,
- @IAccessibilityService accessibilityService: IAccessibilityService
+ @IConfigurationService configurationService: IConfigurationService
) {
- const { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble<T, TFilterData, IWorkbenchObjectTreeOptions<T, TFilterData>>(container, options, contextKeyService, configurationService, keybindingService, accessibilityService);
+ const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, container, options as any);
super(user, container, delegate, renderers, treeOptions);
this.disposables.add(disposable);
- this.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService);
+ this.internals = new WorkbenchTreeInternals(this, options, getTypeNavigationMode, options.overrideStyles, contextKeyService, listService, themeService, configurationService);
this.disposables.add(this.internals);
}
@@ -882,17 +889,16 @@ export class WorkbenchCompressibleObjectTree<T extends NonNullable<any>, TFilter
delegate: IListVirtualDelegate<T>,
renderers: ICompressibleTreeRenderer<T, TFilterData, any>[],
options: IWorkbenchCompressibleObjectTreeOptions<T, TFilterData>,
+ @IInstantiationService instantiationService: IInstantiationService,
@IContextKeyService contextKeyService: IContextKeyService,
@IListService listService: IListService,
@IThemeService themeService: IThemeService,
- @IConfigurationService configurationService: IConfigurationService,
- @IKeybindingService keybindingService: IKeybindingService,
- @IAccessibilityService accessibilityService: IAccessibilityService
+ @IConfigurationService configurationService: IConfigurationService
) {
- const { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble<T, TFilterData, IWorkbenchCompressibleObjectTreeOptions<T, TFilterData>>(container, options, contextKeyService, configurationService, keybindingService, accessibilityService);
+ const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, container, options as any);
super(user, container, delegate, renderers, treeOptions);
this.disposables.add(disposable);
- this.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService);
+ this.internals = new WorkbenchTreeInternals(this, options, getTypeNavigationMode, options.overrideStyles, contextKeyService, listService, themeService, configurationService);
this.disposables.add(this.internals);
}
@@ -930,17 +936,16 @@ export class WorkbenchDataTree<TInput, T, TFilterData = void> extends DataTree<T
renderers: ITreeRenderer<T, TFilterData, any>[],
dataSource: IDataSource<TInput, T>,
options: IWorkbenchDataTreeOptions<T, TFilterData>,
+ @IInstantiationService instantiationService: IInstantiationService,
@IContextKeyService contextKeyService: IContextKeyService,
@IListService listService: IListService,
@IThemeService themeService: IThemeService,
- @IConfigurationService configurationService: IConfigurationService,
- @IKeybindingService keybindingService: IKeybindingService,
- @IAccessibilityService accessibilityService: IAccessibilityService
+ @IConfigurationService configurationService: IConfigurationService
) {
- const { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble<T, TFilterData, IWorkbenchDataTreeOptions<T, TFilterData>>(container, options, contextKeyService, configurationService, keybindingService, accessibilityService);
+ const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, container, options as any);
super(user, container, delegate, renderers, dataSource, treeOptions);
this.disposables.add(disposable);
- this.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService);
+ this.internals = new WorkbenchTreeInternals(this, options, getTypeNavigationMode, options.overrideStyles, contextKeyService, listService, themeService, configurationService);
this.disposables.add(this.internals);
}
@@ -978,17 +983,16 @@ export class WorkbenchAsyncDataTree<TInput, T, TFilterData = void> extends Async
renderers: ITreeRenderer<T, TFilterData, any>[],
dataSource: IAsyncDataSource<TInput, T>,
options: IWorkbenchAsyncDataTreeOptions<T, TFilterData>,
+ @IInstantiationService instantiationService: IInstantiationService,
@IContextKeyService contextKeyService: IContextKeyService,
@IListService listService: IListService,
@IThemeService themeService: IThemeService,
- @IConfigurationService configurationService: IConfigurationService,
- @IKeybindingService keybindingService: IKeybindingService,
- @IAccessibilityService accessibilityService: IAccessibilityService
+ @IConfigurationService configurationService: IConfigurationService
) {
- const { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble<T, TFilterData, IWorkbenchAsyncDataTreeOptions<T, TFilterData>>(container, options, contextKeyService, configurationService, keybindingService, accessibilityService);
+ const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, container, options as any);
super(user, container, delegate, renderers, dataSource, treeOptions);
this.disposables.add(disposable);
- this.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService);
+ this.internals = new WorkbenchTreeInternals(this, options, getTypeNavigationMode, options.overrideStyles, contextKeyService, listService, themeService, configurationService);
this.disposables.add(this.internals);
}
@@ -1024,17 +1028,16 @@ export class WorkbenchCompressibleAsyncDataTree<TInput, T, TFilterData = void> e
renderers: ICompressibleTreeRenderer<T, TFilterData, any>[],
dataSource: IAsyncDataSource<TInput, T>,
options: IWorkbenchCompressibleAsyncDataTreeOptions<T, TFilterData>,
+ @IInstantiationService instantiationService: IInstantiationService,
@IContextKeyService contextKeyService: IContextKeyService,
@IListService listService: IListService,
@IThemeService themeService: IThemeService,
- @IConfigurationService configurationService: IConfigurationService,
- @IKeybindingService keybindingService: IKeybindingService,
- @IAccessibilityService accessibilityService: IAccessibilityService
+ @IConfigurationService configurationService: IConfigurationService
) {
- const { options: treeOptions, getAutomaticKeyboardNavigation, disposable } = workbenchTreeDataPreamble<T, TFilterData, IWorkbenchCompressibleAsyncDataTreeOptions<T, TFilterData>>(container, options, contextKeyService, configurationService, keybindingService, accessibilityService);
+ const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, container, options as any);
super(user, container, virtualDelegate, compressionDelegate, renderers, dataSource, treeOptions);
this.disposables.add(disposable);
- this.internals = new WorkbenchTreeInternals(this, options, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService);
+ this.internals = new WorkbenchTreeInternals(this, options, getTypeNavigationMode, options.overrideStyles, contextKeyService, listService, themeService, configurationService);
this.disposables.add(this.internals);
}
@@ -1044,33 +1047,62 @@ export class WorkbenchCompressibleAsyncDataTree<TInput, T, TFilterData = void> e
}
}
+function getDefaultTreeFindMode(configurationService: IConfigurationService) {
+ const value = configurationService.getValue<'highlight' | 'filter'>(defaultFindModeSettingKey);
+
+ if (value === 'highlight') {
+ return TreeFindMode.Highlight;
+ } else if (value === 'filter') {
+ return TreeFindMode.Filter;
+ }
+
+ const deprecatedValue = configurationService.getValue<'simple' | 'highlight' | 'filter'>(keyboardNavigationSettingKey);
+
+ if (deprecatedValue === 'simple' || deprecatedValue === 'highlight') {
+ return TreeFindMode.Highlight;
+ } else if (deprecatedValue === 'filter') {
+ return TreeFindMode.Filter;
+ }
+
+ return undefined;
+}
+
function workbenchTreeDataPreamble<T, TFilterData, TOptions extends IAbstractTreeOptions<T, TFilterData> | IAsyncDataTreeOptions<T, TFilterData>>(
+ accessor: ServicesAccessor,
container: HTMLElement,
options: TOptions,
- contextKeyService: IContextKeyService,
- configurationService: IConfigurationService,
- keybindingService: IKeybindingService,
- accessibilityService: IAccessibilityService,
-): { options: TOptions; getAutomaticKeyboardNavigation: () => boolean | undefined; disposable: IDisposable } {
- const getAutomaticKeyboardNavigation = () => {
- // give priority to the context key value to disable this completely
- let automaticKeyboardNavigation = Boolean(contextKeyService.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationKey));
-
- if (automaticKeyboardNavigation) {
- automaticKeyboardNavigation = Boolean(configurationService.getValue(automaticKeyboardNavigationSettingKey));
+): { options: TOptions; getTypeNavigationMode: () => TypeNavigationMode | undefined; disposable: IDisposable } {
+ const configurationService = accessor.get(IConfigurationService);
+ const keybindingService = accessor.get(IKeybindingService);
+ const contextViewService = accessor.get(IContextViewService);
+ const contextKeyService = accessor.get(IContextKeyService);
+
+ const getTypeNavigationMode = () => {
+ // give priority to the context key value to specify a value
+ const modeString = contextKeyService.getContextKeyValue<'automatic' | 'trigger'>(WorkbenchListTypeNavigationModeKey);
+
+ if (modeString === 'automatic') {
+ return TypeNavigationMode.Automatic;
+ } else if (modeString === 'trigger') {
+ return TypeNavigationMode.Trigger;
+ }
+
+ // also check the deprecated context key to set the mode to 'trigger'
+ const modeBoolean = contextKeyService.getContextKeyValue<boolean>(WorkbenchListAutomaticKeyboardNavigationLegacyKey);
+
+ if (modeBoolean === false) {
+ return TypeNavigationMode.Trigger;
}
- return automaticKeyboardNavigation;
+ return undefined;
};
- const accessibilityOn = accessibilityService.isScreenReaderOptimized();
- const keyboardNavigation = options.simpleKeyboardNavigation || accessibilityOn ? 'simple' : configurationService.getValue<string>(keyboardNavigationSettingKey);
const horizontalScrolling = options.horizontalScrolling !== undefined ? options.horizontalScrolling : Boolean(configurationService.getValue(horizontalScrollingKey));
const [workbenchListOptions, disposable] = toWorkbenchListOptions(options, configurationService, keybindingService);
const additionalScrollHeight = options.additionalScrollHeight;
return {
- getAutomaticKeyboardNavigation,
+ getTypeNavigationMode,
disposable,
options: {
// ...options, // TODO@Joao why is this not splatted here?
@@ -1079,14 +1111,13 @@ function workbenchTreeDataPreamble<T, TFilterData, TOptions extends IAbstractTre
indent: typeof configurationService.getValue(treeIndentKey) === 'number' ? configurationService.getValue(treeIndentKey) : undefined,
renderIndentGuides: configurationService.getValue<RenderIndentGuides>(treeRenderIndentGuidesKey),
smoothScrolling: Boolean(configurationService.getValue(listSmoothScrolling)),
- automaticKeyboardNavigation: getAutomaticKeyboardNavigation(),
- simpleKeyboardNavigation: keyboardNavigation === 'simple',
- filterOnType: keyboardNavigation === 'filter',
+ defaultFindMode: getDefaultTreeFindMode(configurationService),
horizontalScrolling,
keyboardNavigationEventFilter: createKeyboardNavigationEventFilter(container, keybindingService),
additionalScrollHeight,
hideTwistiesOfChildlessElements: options.hideTwistiesOfChildlessElements,
- expandOnlyOnTwistieClick: options.expandOnlyOnTwistieClick ?? (configurationService.getValue<'singleClick' | 'doubleClick'>(treeExpandMode) === 'doubleClick')
+ expandOnlyOnTwistieClick: options.expandOnlyOnTwistieClick ?? (configurationService.getValue<'singleClick' | 'doubleClick'>(treeExpandMode) === 'doubleClick'),
+ contextViewProvider: contextViewService as IContextViewProvider
} as TOptions
};
}
@@ -1106,6 +1137,7 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
private treeElementHasParent: IContextKey<boolean>;
private treeElementCanExpand: IContextKey<boolean>;
private treeElementHasChild: IContextKey<boolean>;
+ private treeFindOpen: IContextKey<boolean>;
private _useAltAsMultipleSelectionModifier: boolean;
private disposables: IDisposable[] = [];
private styler: IDisposable | undefined;
@@ -1116,13 +1148,12 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
constructor(
private tree: WorkbenchObjectTree<T, TFilterData> | WorkbenchCompressibleObjectTree<T, TFilterData> | WorkbenchDataTree<TInput, T, TFilterData> | WorkbenchAsyncDataTree<TInput, T, TFilterData> | WorkbenchCompressibleAsyncDataTree<TInput, T, TFilterData>,
options: IWorkbenchObjectTreeOptions<T, TFilterData> | IWorkbenchCompressibleObjectTreeOptions<T, TFilterData> | IWorkbenchDataTreeOptions<T, TFilterData> | IWorkbenchAsyncDataTreeOptions<T, TFilterData> | IWorkbenchCompressibleAsyncDataTreeOptions<T, TFilterData>,
- getAutomaticKeyboardNavigation: () => boolean | undefined,
+ getTypeNavigationMode: () => TypeNavigationMode | undefined,
overrideStyles: IColorMapping | undefined,
@IContextKeyService contextKeyService: IContextKeyService,
@IListService listService: IListService,
@IThemeService private themeService: IThemeService,
- @IConfigurationService configurationService: IConfigurationService,
- @IAccessibilityService accessibilityService: IAccessibilityService,
+ @IConfigurationService configurationService: IConfigurationService
) {
this.contextKeyService = createScopedContextKeyService(contextKeyService, tree);
@@ -1140,20 +1171,10 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
this.treeElementHasParent = WorkbenchTreeElementHasParent.bindTo(this.contextKeyService);
this.treeElementCanExpand = WorkbenchTreeElementCanExpand.bindTo(this.contextKeyService);
this.treeElementHasChild = WorkbenchTreeElementHasChild.bindTo(this.contextKeyService);
+ this.treeFindOpen = WorkbenchTreeFindOpen.bindTo(this.contextKeyService);
this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);
- const interestingContextKeys = new Set();
- interestingContextKeys.add(WorkbenchListAutomaticKeyboardNavigationKey);
- const updateKeyboardNavigation = () => {
- const accessibilityOn = accessibilityService.isScreenReaderOptimized();
- const keyboardNavigation = accessibilityOn ? 'simple' : configurationService.getValue<string>(keyboardNavigationSettingKey);
- tree.updateOptions({
- simpleKeyboardNavigation: keyboardNavigation === 'simple',
- filterOnType: keyboardNavigation === 'filter'
- });
- };
-
this.updateStyleOverrides(overrideStyles);
const updateCollapseContextKeys = () => {
@@ -1170,6 +1191,10 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
this.treeElementHasChild.set(!!tree.getFirstElementChild(focus));
};
+ const interestingContextKeys = new Set();
+ interestingContextKeys.add(WorkbenchListTypeNavigationModeKey);
+ interestingContextKeys.add(WorkbenchListAutomaticKeyboardNavigationLegacyKey);
+
this.disposables.push(
this.contextKeyService,
(listService as ListService).register(tree),
@@ -1192,6 +1217,7 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
}),
tree.onDidChangeCollapseState(updateCollapseContextKeys),
tree.onDidChangeModel(updateCollapseContextKeys),
+ tree.onDidChangeFindOpenState(enabled => this.treeFindOpen.set(enabled)),
configurationService.onDidChangeConfiguration(e => {
let newOptions: IAbstractTreeOptionsUpdate = {};
if (e.affectsConfiguration(multiSelectModifierSettingKey)) {
@@ -1209,11 +1235,8 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
const smoothScrolling = Boolean(configurationService.getValue(listSmoothScrolling));
newOptions = { ...newOptions, smoothScrolling };
}
- if (e.affectsConfiguration(keyboardNavigationSettingKey)) {
- updateKeyboardNavigation();
- }
- if (e.affectsConfiguration(automaticKeyboardNavigationSettingKey)) {
- newOptions = { ...newOptions, automaticKeyboardNavigation: getAutomaticKeyboardNavigation() };
+ if (e.affectsConfiguration(defaultFindModeSettingKey) || e.affectsConfiguration(keyboardNavigationSettingKey)) {
+ tree.updateOptions({ defaultFindMode: getDefaultTreeFindMode(configurationService) });
}
if (e.affectsConfiguration(horizontalScrollingKey) && options.horizontalScrolling === undefined) {
const horizontalScrolling = Boolean(configurationService.getValue(horizontalScrollingKey));
@@ -1236,10 +1259,9 @@ class WorkbenchTreeInternals<TInput, T, TFilterData> {
}),
this.contextKeyService.onDidChangeContext(e => {
if (e.affectsSome(interestingContextKeys)) {
- tree.updateOptions({ automaticKeyboardNavigation: getAutomaticKeyboardNavigation() });
+ tree.updateOptions({ typeNavigationMode: getTypeNavigationMode() });
}
- }),
- accessibilityService.onDidChangeScreenReaderOptimized(() => updateKeyboardNavigation())
+ })
);
this.navigator = new TreeResourceNavigator(tree, { configurationService, ...options });
@@ -1334,6 +1356,16 @@ configurationRegistry.registerConfiguration({
default: 5,
description: localize('Fast Scroll Sensitivity', "Scrolling speed multiplier when pressing `Alt`.")
},
+ [defaultFindModeSettingKey]: {
+ type: 'string',
+ enum: ['highlight', 'filter'],
+ enumDescriptions: [
+ localize('defaultFindModeSettingKey.highlight', "Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),
+ localize('defaultFindModeSettingKey.filter', "Filter elements when searching.")
+ ],
+ default: 'highlight',
+ description: localize('defaultFindModeSettingKey', "Controls the default find mode for lists and trees in the workbench.")
+ },
[keyboardNavigationSettingKey]: {
type: 'string',
enum: ['simple', 'highlight', 'filter'],
@@ -1343,12 +1375,9 @@ configurationRegistry.registerConfiguration({
localize('keyboardNavigationSettingKey.filter', "Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")
],
default: 'highlight',
- description: localize('keyboardNavigationSettingKey', "Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.")
- },
- [automaticKeyboardNavigationSettingKey]: {
- type: 'boolean',
- default: true,
- markdownDescription: localize('automatic keyboard navigation setting', "Controls whether keyboard navigation in lists and trees is automatically triggered simply by typing. If set to `false`, keyboard navigation is only triggered when executing the `list.toggleKeyboardNavigation` command, for which you can assign a keyboard shortcut.")
+ description: localize('keyboardNavigationSettingKey', "Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),
+ deprecated: true,
+ deprecationMessage: localize('keyboardNavigationSettingKeyDeprecated', "Please use 'workbench.list.defaultFindMode' instead.")
},
[treeExpandMode]: {
type: 'string',