diff --git a/src/vs/workbench/contrib/interactiveSession/browser/interactiveSessionListRenderer.ts b/src/vs/workbench/contrib/interactiveSession/browser/interactiveSessionListRenderer.ts index 585f865bf36..e5dcc557728 100644 --- a/src/vs/workbench/contrib/interactiveSession/browser/interactiveSessionListRenderer.ts +++ b/src/vs/workbench/contrib/interactiveSession/browser/interactiveSessionListRenderer.ts @@ -59,7 +59,7 @@ interface IItemHeightChangeParams { const wordRenderRate = 8; // words/sec -const enableVerboseLayoutTracing = false; +const forceVerboseLayoutTracing = false; export class InteractiveListItemRenderer extends Disposable implements ITreeRenderer { static readonly cursorCharacter = '\u258c'; @@ -94,7 +94,7 @@ export class InteractiveListItemRenderer extends Disposable implements ITreeRend } private traceLayout(method: string, message: string) { - if (enableVerboseLayoutTracing) { + if (forceVerboseLayoutTracing) { this.logService.info(`${method}: ${message}`); } else { this.logService.trace(`${method}: ${message}`); @@ -281,8 +281,10 @@ export class InteractiveSessionListDelegate implements IListVirtualDelegate this.getBackgroundColor(), () => this.getBackgroundColor(), () => editorBackground)); + const scopedInstantiationService = this.instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService])); + this.view = this._register(scopedInstantiationService.createInstance(InteractiveSessionWidget, interactiveSessionViewOptions.providerId, this.id, () => this.getBackgroundColor(), () => this.getBackgroundColor(), () => editorBackground)); this._register(this.onDidChangeBodyVisibility(visible => { this.view.setVisible(visible); diff --git a/src/vs/workbench/contrib/interactiveSession/browser/interactiveSessionWidget.ts b/src/vs/workbench/contrib/interactiveSession/browser/interactiveSessionWidget.ts index 86fee6ca4ee..e560b2718fa 100644 --- a/src/vs/workbench/contrib/interactiveSession/browser/interactiveSessionWidget.ts +++ b/src/vs/workbench/contrib/interactiveSession/browser/interactiveSessionWidget.ts @@ -133,7 +133,10 @@ export class InteractiveSessionWidget extends Disposable { }; }); - this.setWelcomeViewVisible(false); + if (treeItems.length > 0) { + this.setWelcomeViewVisible(false); + } + const lastItem = treeItems[treeItems.length - 1]; this.tree.setChildren(null, treeItems, { diffIdentityProvider: { @@ -284,7 +287,8 @@ export class InteractiveSessionWidget extends Disposable { options.cursorWidth = 1; options.wrappingStrategy = 'advanced'; - this.inputEditor = this._register(scopedInstantiationService.createInstance(CodeEditorWidget, inputContainer, options, getSimpleCodeEditorWidgetOptions())); + const inputEditorElement = dom.append(inputContainer, $('.interactive-input-editor')); + this.inputEditor = this._register(scopedInstantiationService.createInstance(CodeEditorWidget, inputEditorElement, options, getSimpleCodeEditorWidgetOptions())); this._register(this.inputEditor.onDidChangeModelContent(() => { const currentHeight = Math.min(this.inputEditor.getContentHeight(), INPUT_EDITOR_MAX_HEIGHT);