Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete breadcrumbs.filterOnType unused setting. #75971

Merged
merged 1 commit into from
Jun 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/vs/workbench/browser/parts/editor/breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export abstract class BreadcrumbsConfig<T> {
static FilePath = BreadcrumbsConfig._stub<'on' | 'off' | 'last'>('breadcrumbs.filePath');
static SymbolPath = BreadcrumbsConfig._stub<'on' | 'off' | 'last'>('breadcrumbs.symbolPath');
static SymbolSortOrder = BreadcrumbsConfig._stub<'position' | 'name' | 'type'>('breadcrumbs.symbolSortOrder');
static FilterOnType = BreadcrumbsConfig._stub<boolean>('breadcrumbs.filterOnType');

static FileExcludes = BreadcrumbsConfig._stub<glob.IExpression>('files.exclude');

Expand Down Expand Up @@ -161,12 +160,7 @@ Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfigurat
localize('symbolSortOrder.name', "Show symbol outline in alphabetical order."),
localize('symbolSortOrder.type', "Show symbol outline in symbol type order."),
]
},
// 'breadcrumbs.filterOnType': {
// description: localize('filterOnType', "Controls whether the breadcrumb picker filters or highlights when typing."),
// type: 'boolean',
// default: false
// },
}
}
});

Expand Down
15 changes: 1 addition & 14 deletions src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { basename, dirname, isEqual } from 'vs/base/common/resources';
import { URI } from 'vs/base/common/uri';
import 'vs/css!./media/breadcrumbscontrol';
import { OutlineElement, OutlineModel, TreeElement } from 'vs/editor/contrib/documentSymbols/outlineModel';
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { FileKind, IFileService, IFileStat } from 'vs/platform/files/common/files';
import { IConstructorSignature1, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { WorkbenchDataTree, WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';
Expand Down Expand Up @@ -102,10 +102,6 @@ export abstract class BreadcrumbsPicker {
this._treeContainer.style.boxShadow = `0px 5px 8px ${this._themeService.getTheme().getColor(widgetShadow)}`;
this._domNode.appendChild(this._treeContainer);


const filterConfig = BreadcrumbsConfig.FilterOnType.bindTo(this._configurationService);
this._disposables.push(filterConfig);

this._layoutInfo = { maxHeight, width, arrowSize, arrowOffset, inputHeight: 0 };
this._tree = this._createTree(this._treeContainer);

Expand All @@ -129,13 +125,6 @@ export abstract class BreadcrumbsPicker {
this._layout();
}));

// filter on type: state
const cfgFilterOnType = BreadcrumbsConfig.FilterOnType.bindTo(this._configurationService);
this._tree.updateOptions({ filterOnType: cfgFilterOnType.getValue() });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overrides the setting workbench.list.keyboardNavigation and because breadcrumbs.filterOnType is commented its value is undefined/false, so the BreadcrumbsPicker tree won't filter on type after a launch/reload unless the TypeFilterController widget of the tree is clicked which modifes the filterOnType setting

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡

this._disposables.push(this._tree.onDidUpdateOptions(e => {
this._configurationService.updateValue(cfgFilterOnType.name, e.filterOnType, ConfigurationTarget.MEMORY);
}));

this._domNode.focus();

this._setInput(input).then(() => {
Expand Down Expand Up @@ -389,7 +378,6 @@ export class BreadcrumbsFilePicker extends BreadcrumbsPicker {
this._disposables.push(labels);

return this._instantiationService.createInstance(WorkbenchAsyncDataTree, container, new FileVirtualDelegate(), [this._instantiationService.createInstance(FileRenderer, labels)], this._instantiationService.createInstance(FileDataSource), {
filterOnType: true,
multipleSelectionSupport: false,
sorter: new FileSorter(),
filter: this._instantiationService.createInstance(FileFilter),
Expand Down Expand Up @@ -467,7 +455,6 @@ export class BreadcrumbsOutlinePicker extends BreadcrumbsPicker {
[new OutlineGroupRenderer(), this._instantiationService.createInstance(OutlineElementRenderer)],
new OutlineDataSource(),
{
filterOnType: true,
expandOnlyOnTwistieClick: true,
multipleSelectionSupport: false,
sorter: new OutlineItemComparator(this._getOutlineItemCompareType()),
Expand Down