提交 382e1a02 编写于 作者: J Joao Moreno

fixes #74934

上级 eedf49f6
......@@ -225,6 +225,7 @@ function asObjectTreeOptions<TInput, T, TFilterData>(options?: IAsyncDataTreeOpt
}
},
keyboardNavigationLabelProvider: options.keyboardNavigationLabelProvider && {
...options.keyboardNavigationLabelProvider,
getKeyboardNavigationLabel(e) {
return options.keyboardNavigationLabelProvider!.getKeyboardNavigationLabel(e.element as T);
}
......
......@@ -15,7 +15,6 @@ import { Range } from 'vs/editor/common/core/range';
import { SymbolKind, symbolKindToCssClass } from 'vs/editor/common/modes';
import { OutlineElement, OutlineGroup, OutlineModel, TreeElement } from 'vs/editor/contrib/documentSymbols/outlineModel';
import { localize } from 'vs/nls';
import { IKeybindingService, IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding';
import { IconLabel } from 'vs/base/browser/ui/iconLabel/iconLabel';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { OutlineConfigKeys } from 'vs/editor/contrib/documentSymbols/outline';
......@@ -27,8 +26,6 @@ export type OutlineItem = OutlineGroup | OutlineElement;
export class OutlineNavigationLabelProvider implements IKeyboardNavigationLabelProvider<OutlineItem> {
constructor(@IKeybindingService private readonly _keybindingService: IKeybindingService) { }
getKeyboardNavigationLabel(element: OutlineItem): { toString(): string; } {
if (element instanceof OutlineGroup) {
return element.provider.displayName || element.id;
......@@ -36,10 +33,6 @@ export class OutlineNavigationLabelProvider implements IKeyboardNavigationLabelP
return element.symbol.name;
}
}
mightProducePrintableCharacter(event: IKeyboardEvent): boolean {
return this._keybindingService.mightProducePrintableCharacter(event);
}
}
......
......@@ -459,7 +459,7 @@ export class BreadcrumbsOutlinePicker extends BreadcrumbsPicker {
multipleSelectionSupport: false,
sorter: new OutlineItemComparator(this._getOutlineItemCompareType()),
identityProvider: new OutlineIdentityProvider(),
keyboardNavigationLabelProvider: this._instantiationService.createInstance(OutlineNavigationLabelProvider)
keyboardNavigationLabelProvider: new OutlineNavigationLabelProvider()
}
) as WorkbenchDataTree<OutlineModel, OutlineItem, FuzzyScore>;
}
......
......@@ -327,7 +327,7 @@ export class OutlinePanel extends ViewletPanel {
filterOnType: this._outlineViewState.filterOnType,
sorter: this._treeComparator,
identityProvider: new OutlineIdentityProvider(),
keyboardNavigationLabelProvider: this._instantiationService.createInstance(OutlineNavigationLabelProvider)
keyboardNavigationLabelProvider: new OutlineNavigationLabelProvider()
}
) as WorkbenchDataTree<OutlineModel, OutlineItem, FuzzyScore>;
......
......@@ -531,6 +531,10 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
// ignore ctrl/cmd-combination but not shift/alt-combinatios
return false;
}
if (event.keyCode === KeyCode.Escape) {
// https://github.com/microsoft/vscode/issues/74934
return false;
}
// consult the KeyboardMapperFactory to check the given event for
// a printable value.
const mapping = this.keymapService.getRawKeyboardMapping();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册