mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-20 15:19:54 +01:00
use WorkbenchTreeController
This commit is contained in:
@@ -176,9 +176,9 @@ export class OutlinePanel extends ViewsViewletPanel {
|
||||
@IThemeService private readonly _themeService: IThemeService,
|
||||
@IStorageService private readonly _storageService: IStorageService,
|
||||
@IWorkbenchEditorService private readonly _editorService: IWorkbenchEditorService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@IContextMenuService contextMenuService: IContextMenuService,
|
||||
@IConfigurationService configurationService: IConfigurationService
|
||||
) {
|
||||
super(options, keybindingService, contextMenuService, configurationService);
|
||||
|
||||
@@ -231,7 +231,10 @@ export class OutlinePanel extends ViewsViewletPanel {
|
||||
const controller = new class extends OutlineController {
|
||||
|
||||
private readonly _mapper = KeyboardMapperFactory.INSTANCE;
|
||||
// private readonly _ignored = { [KeyCode.Shift]: true,/* [KeyCode.Ctrl]: true, [KeyCode.Alt]: true, [KeyCode.Meta]: true */ };
|
||||
|
||||
constructor() {
|
||||
super({}, $this.configurationService);
|
||||
}
|
||||
|
||||
onKeyDown(tree: ITree, event: IKeyboardEvent) {
|
||||
let handled = super.onKeyDown(tree, event);
|
||||
@@ -248,11 +251,12 @@ export class OutlinePanel extends ViewsViewletPanel {
|
||||
if (!mapping) {
|
||||
return false;
|
||||
}
|
||||
const value = mapping[event.code];
|
||||
if (value.value) {
|
||||
const keyInfo = mapping[event.code];
|
||||
if (keyInfo.value) {
|
||||
$this._input.focus();
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
const dataSource = new OutlineDataSource();
|
||||
|
||||
@@ -12,7 +12,6 @@ import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { createMatches } from 'vs/base/common/filters';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IDataSource, IFilter, IRenderer, ISorter, ITree } from 'vs/base/parts/tree/browser/tree';
|
||||
import { DefaultController } from 'vs/base/parts/tree/browser/treeDefaults';
|
||||
import 'vs/css!./media/symbol-icons';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { symbolKindToCssClass } from 'vs/editor/common/modes';
|
||||
@@ -22,6 +21,7 @@ import { getPathLabel } from 'vs/base/common/labels';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { localize } from 'vs/nls';
|
||||
import { WorkbenchTreeController } from 'vs/platform/list/browser/listService';
|
||||
|
||||
export enum OutlineItemCompareType {
|
||||
ByPosition,
|
||||
@@ -234,7 +234,7 @@ export class OutlineTreeState {
|
||||
}
|
||||
}
|
||||
|
||||
export class OutlineController extends DefaultController {
|
||||
export class OutlineController extends WorkbenchTreeController {
|
||||
|
||||
protected onLeftClick(tree: ITree, element: any, event: IMouseEvent, origin: string = 'mouse'): boolean {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user