提交 bf92ab39 编写于 作者: B Benjamin Pasero

list service for repl (for #11517)

上级 f0e59a39
......@@ -39,12 +39,14 @@ import { ReplHistory } from 'vs/workbench/parts/debug/common/replHistory';
import { Panel } from 'vs/workbench/browser/panel';
import { IThemeService } from 'vs/workbench/services/themes/common/themeService';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { IListService } from 'vs/platform/list/browser/listService';
const $ = dom.$;
const replTreeOptions: ITreeOptions = {
twistiePixels: 20,
ariaLabel: nls.localize('replAriaLabel', "Read Eval Print Loop Panel")
ariaLabel: nls.localize('replAriaLabel', "Read Eval Print Loop Panel"),
keyboardSupport: false
};
const HISTORY_STORAGE_KEY = 'debug.repl.history';
......@@ -86,7 +88,8 @@ export class Repl extends Panel implements IPrivateReplService {
@IPanelService private panelService: IPanelService,
@IThemeService private themeService: IThemeService,
@IModelService private modelService: IModelService,
@IContextKeyService private contextKeyService: IContextKeyService
@IContextKeyService private contextKeyService: IContextKeyService,
@IListService private listService: IListService
) {
super(debug.REPL_ID, telemetryService);
......@@ -147,6 +150,8 @@ export class Repl extends Panel implements IPrivateReplService {
controller
}, replTreeOptions);
this.toDispose.push(this.listService.register(this.tree));
if (!Repl.HISTORY) {
Repl.HISTORY = new ReplHistory(JSON.parse(this.storageService.get(HISTORY_STORAGE_KEY, StorageScope.WORKSPACE, '[]')));
}
......
......@@ -9,7 +9,6 @@ import { IAction } from 'vs/base/common/actions';
import { isFullWidthCharacter, removeAnsiEscapeCodes, endsWith } from 'vs/base/common/strings';
import uri from 'vs/base/common/uri';
import { isMacintosh } from 'vs/base/common/platform';
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar';
import * as dom from 'vs/base/browser/dom';
import * as errors from 'vs/base/common/errors';
......@@ -513,16 +512,4 @@ export class ReplExpressionsController extends BaseDebugController {
return true;
}
protected onDown(tree: ITree, event: IKeyboardEvent): boolean {
if (tree.getFocus()) {
return super.onDown(tree, event);
}
const payload = { origin: 'keyboard', originalEvent: event };
tree.focusLast(payload);
tree.reveal(tree.getFocus()).done(null, errors.onUnexpectedError);
return true;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册