未验证 提交 4b88d528 编写于 作者: A Alex Dima

Merge remote-tracking branch 'origin/master' into pr/lmvco/88536

...@@ -58,18 +58,23 @@ export class ListService implements IListService { ...@@ -58,18 +58,23 @@ export class ListService implements IListService {
private disposables = new DisposableStore(); private disposables = new DisposableStore();
private lists: IRegisteredList[] = []; private lists: IRegisteredList[] = [];
private _lastFocusedWidget: ListWidget | undefined = undefined; private _lastFocusedWidget: ListWidget | undefined = undefined;
private _hasCreatedStyleController: boolean = false;
get lastFocusedList(): ListWidget | undefined { get lastFocusedList(): ListWidget | undefined {
return this._lastFocusedWidget; return this._lastFocusedWidget;
} }
constructor(@IThemeService themeService: IThemeService) { constructor(@IThemeService private readonly _themeService: IThemeService) {
}
register(widget: ListWidget, extraContextKeys?: (IContextKey<boolean>)[]): IDisposable {
if (!this._hasCreatedStyleController) {
this._hasCreatedStyleController = true;
// create a shared default tree style sheet for performance reasons // create a shared default tree style sheet for performance reasons
const styleController = new DefaultStyleController(createStyleSheet(), ''); const styleController = new DefaultStyleController(createStyleSheet(), '');
this.disposables.add(attachListStyler(styleController, themeService)); this.disposables.add(attachListStyler(styleController, this._themeService));
} }
register(widget: ListWidget, extraContextKeys?: (IContextKey<boolean>)[]): IDisposable {
if (this.lists.some(l => l.widget === widget)) { if (this.lists.some(l => l.widget === widget)) {
throw new Error('Cannot register the same widget multiple times'); throw new Error('Cannot register the same widget multiple times');
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册