提交 4937aee5 编写于 作者: I isidor

repl: on debugConsole.wordWrap change recreate the tree, do not require a restart

fixes #76095
上级 1e0f94f9
......@@ -87,6 +87,7 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
private tree!: WorkbenchAsyncDataTree<IDebugSession, IReplElement, FuzzyScore>;
private replDelegate!: ReplDelegate;
private container!: HTMLElement;
private treeContainer!: HTMLElement;
private replInput!: CodeEditorWidget;
private replInputContainer!: HTMLElement;
private dimension!: dom.Dimension;
......@@ -237,7 +238,12 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
}
}));
this._register(this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration('debug.console.lineHeight') || e.affectsConfiguration('debug.console.fontSize') || e.affectsConfiguration('debug.console.fontFamily')) {
if (e.affectsConfiguration('debug.console.wordWrap')) {
this.tree.dispose();
this.treeContainer.innerText = '';
dom.clearNode(this.treeContainer);
this.createReplTree();
} else if (e.affectsConfiguration('debug.console.lineHeight') || e.affectsConfiguration('debug.console.fontSize') || e.affectsConfiguration('debug.console.fontFamily')) {
this.onDidStyleChange();
}
}));
......@@ -541,19 +547,21 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
protected renderBody(parent: HTMLElement): void {
super.renderBody(parent);
this.container = dom.append(parent, $('.repl'));
const treeContainer = dom.append(this.container, $(`.repl-tree.${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`));
this.treeContainer = dom.append(this.container, $(`.repl-tree.${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`));
this.createReplInput(this.container);
this.createReplTree();
}
private createReplTree(): void {
this.replDelegate = new ReplDelegate(this.configurationService);
const wordWrap = this.configurationService.getValue<IDebugConfiguration>('debug').console.wordWrap;
treeContainer.classList.toggle('word-wrap', wordWrap);
this.treeContainer.classList.toggle('word-wrap', wordWrap);
const linkDetector = this.instantiationService.createInstance(LinkDetector);
this.tree = <WorkbenchAsyncDataTree<IDebugSession, IReplElement, FuzzyScore>>this.instantiationService.createInstance(
WorkbenchAsyncDataTree,
'DebugRepl',
treeContainer,
this.treeContainer,
this.replDelegate,
[
this.instantiationService.createInstance(ReplVariablesRenderer, linkDetector),
......
......@@ -34,7 +34,6 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
private nativeFullScreen: boolean | undefined;
private clickThroughInactive: boolean | undefined;
private updateMode: string | undefined;
private debugConsoleWordWrap: boolean | undefined;
private accessibilitySupport: 'on' | 'off' | 'auto' | undefined;
constructor(
......@@ -52,12 +51,6 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
private onConfigurationChange(config: IConfiguration, notify: boolean): void {
let changed = false;
// Debug console word wrap
if (typeof config.debug?.console.wordWrap === 'boolean' && config.debug.console.wordWrap !== this.debugConsoleWordWrap) {
this.debugConsoleWordWrap = config.debug.console.wordWrap;
changed = true;
}
if (isNative) {
// Titlebar style
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册