diff options
Diffstat (limited to 'src/vs/platform/list/browser/listService.ts')
-rw-r--r-- | src/vs/platform/list/browser/listService.ts | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index 9716ea6dc75..2bd9c44b14d 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -189,7 +189,6 @@ class MultipleSelectionController<T> extends Disposable implements IMultipleSele function toWorkbenchListOptions<T>( accessor: ServicesAccessor, - container: HTMLElement, options: IListOptions<T>, ): [IListOptions<T>, IDisposable] { const configurationService = accessor.get(IConfigurationService); @@ -203,7 +202,7 @@ function toWorkbenchListOptions<T>( mouseWheelScrollSensitivity: configurationService.getValue<number>(mouseWheelScrollSensitivityKey), fastScrollSensitivity: configurationService.getValue<number>(fastScrollSensitivityKey), multipleSelectionController: options.multipleSelectionController ?? disposables.add(new MultipleSelectionController(configurationService)), - keyboardNavigationEventFilter: createKeyboardNavigationEventFilter(container, keybindingService), + keyboardNavigationEventFilter: createKeyboardNavigationEventFilter(keybindingService), }; return [result, disposables]; @@ -244,7 +243,7 @@ export class WorkbenchList<T> extends List<T> { @IInstantiationService instantiationService: IInstantiationService ) { const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : Boolean(configurationService.getValue(horizontalScrollingKey)); - const [workbenchListOptions, workbenchListOptionsDisposable] = instantiationService.invokeFunction(toWorkbenchListOptions, container, options); + const [workbenchListOptions, workbenchListOptionsDisposable] = instantiationService.invokeFunction(toWorkbenchListOptions, options); super(user, container, delegate, renderers, { @@ -384,7 +383,7 @@ export class WorkbenchPagedList<T> extends PagedList<T> { @IInstantiationService instantiationService: IInstantiationService ) { const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : Boolean(configurationService.getValue(horizontalScrollingKey)); - const [workbenchListOptions, workbenchListOptionsDisposable] = instantiationService.invokeFunction(toWorkbenchListOptions, container, options); + const [workbenchListOptions, workbenchListOptionsDisposable] = instantiationService.invokeFunction(toWorkbenchListOptions, options); super(user, container, delegate, renderers, { keyboardSupport: false, @@ -517,7 +516,7 @@ export class WorkbenchTable<TRow> extends Table<TRow> { @IInstantiationService instantiationService: IInstantiationService ) { const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : Boolean(configurationService.getValue(horizontalScrollingKey)); - const [workbenchListOptions, workbenchListOptionsDisposable] = instantiationService.invokeFunction(toWorkbenchListOptions, container, options); + const [workbenchListOptions, workbenchListOptionsDisposable] = instantiationService.invokeFunction(toWorkbenchListOptions, options); super(user, container, delegate, columns, renderers, { @@ -812,7 +811,7 @@ class TreeResourceNavigator<T, TFilterData> extends ResourceNavigator<T> { } } -function createKeyboardNavigationEventFilter(container: HTMLElement, keybindingService: IKeybindingService): IKeyboardNavigationEventFilter { +function createKeyboardNavigationEventFilter(keybindingService: IKeybindingService): IKeyboardNavigationEventFilter { let inChord = false; return event => { @@ -825,7 +824,7 @@ function createKeyboardNavigationEventFilter(container: HTMLElement, keybindingS return false; } - const result = keybindingService.softDispatch(event, container); + const result = keybindingService.softDispatch(event, event.target); if (result?.enterChord) { inChord = true; @@ -862,7 +861,7 @@ export class WorkbenchObjectTree<T extends NonNullable<any>, TFilterData = void> @IThemeService themeService: IThemeService, @IConfigurationService configurationService: IConfigurationService ) { - const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, container, options as any); + const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, options as any); super(user, container, delegate, renderers, treeOptions); this.disposables.add(disposable); this.internals = new WorkbenchTreeInternals(this, options, getTypeNavigationMode, options.overrideStyles, contextKeyService, listService, themeService, configurationService); @@ -903,7 +902,7 @@ export class WorkbenchCompressibleObjectTree<T extends NonNullable<any>, TFilter @IThemeService themeService: IThemeService, @IConfigurationService configurationService: IConfigurationService ) { - const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, container, options as any); + const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, options as any); super(user, container, delegate, renderers, treeOptions); this.disposables.add(disposable); this.internals = new WorkbenchTreeInternals(this, options, getTypeNavigationMode, options.overrideStyles, contextKeyService, listService, themeService, configurationService); @@ -950,7 +949,7 @@ export class WorkbenchDataTree<TInput, T, TFilterData = void> extends DataTree<T @IThemeService themeService: IThemeService, @IConfigurationService configurationService: IConfigurationService ) { - const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, container, options as any); + const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, options as any); super(user, container, delegate, renderers, dataSource, treeOptions); this.disposables.add(disposable); this.internals = new WorkbenchTreeInternals(this, options, getTypeNavigationMode, options.overrideStyles, contextKeyService, listService, themeService, configurationService); @@ -997,7 +996,7 @@ export class WorkbenchAsyncDataTree<TInput, T, TFilterData = void> extends Async @IThemeService themeService: IThemeService, @IConfigurationService configurationService: IConfigurationService ) { - const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, container, options as any); + const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, options as any); super(user, container, delegate, renderers, dataSource, treeOptions); this.disposables.add(disposable); this.internals = new WorkbenchTreeInternals(this, options, getTypeNavigationMode, options.overrideStyles, contextKeyService, listService, themeService, configurationService); @@ -1042,7 +1041,7 @@ export class WorkbenchCompressibleAsyncDataTree<TInput, T, TFilterData = void> e @IThemeService themeService: IThemeService, @IConfigurationService configurationService: IConfigurationService ) { - const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, container, options as any); + const { options: treeOptions, getTypeNavigationMode, disposable } = instantiationService.invokeFunction(workbenchTreeDataPreamble, options as any); super(user, container, virtualDelegate, compressionDelegate, renderers, dataSource, treeOptions); this.disposables.add(disposable); this.internals = new WorkbenchTreeInternals(this, options, getTypeNavigationMode, options.overrideStyles, contextKeyService, listService, themeService, configurationService); @@ -1077,11 +1076,9 @@ function getDefaultTreeFindMode(configurationService: IConfigurationService) { function workbenchTreeDataPreamble<T, TFilterData, TOptions extends IAbstractTreeOptions<T, TFilterData> | IAsyncDataTreeOptions<T, TFilterData>>( accessor: ServicesAccessor, - container: HTMLElement, options: TOptions, ): { 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 instantiationService = accessor.get(IInstantiationService); @@ -1107,7 +1104,7 @@ function workbenchTreeDataPreamble<T, TFilterData, TOptions extends IAbstractTre }; const horizontalScrolling = options.horizontalScrolling !== undefined ? options.horizontalScrolling : Boolean(configurationService.getValue(horizontalScrollingKey)); - const [workbenchListOptions, disposable] = instantiationService.invokeFunction(toWorkbenchListOptions, container, options); + const [workbenchListOptions, disposable] = instantiationService.invokeFunction(toWorkbenchListOptions, options); const additionalScrollHeight = options.additionalScrollHeight; return { @@ -1122,7 +1119,6 @@ function workbenchTreeDataPreamble<T, TFilterData, TOptions extends IAbstractTre smoothScrolling: Boolean(configurationService.getValue(listSmoothScrolling)), defaultFindMode: getDefaultTreeFindMode(configurationService), horizontalScrolling, - keyboardNavigationEventFilter: createKeyboardNavigationEventFilter(container, keybindingService), additionalScrollHeight, hideTwistiesOfChildlessElements: options.hideTwistiesOfChildlessElements, expandOnlyOnTwistieClick: options.expandOnlyOnTwistieClick ?? (configurationService.getValue<'singleClick' | 'doubleClick'>(treeExpandMode) === 'doubleClick'), |