Fix context key service warning (#176186)

And issue with hiding welcome view at the wrong time
This commit is contained in:
Rob Lourens
2023-03-06 02:12:44 -05:00
committed by GitHub
parent 0cab3cc3cb
commit 99002e1d01
3 changed files with 15 additions and 7 deletions
@@ -59,7 +59,7 @@ interface IItemHeightChangeParams {
const wordRenderRate = 8; // words/sec
const enableVerboseLayoutTracing = false;
const forceVerboseLayoutTracing = false;
export class InteractiveListItemRenderer extends Disposable implements ITreeRenderer<InteractiveTreeItem, FuzzyScore, IInteractiveListItemTemplate> {
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<Inte
) { }
private _traceLayout(method: string, message: string) {
if (enableVerboseLayoutTracing) {
if (forceVerboseLayoutTracing) {
this.logService.info(`InteractiveSessionListDelegate#${method}: ${message}`);
} else {
this.logService.trace(`InteractiveSessionListDelegate#${method}: ${message}`);
}
}
@@ -7,6 +7,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
@@ -27,7 +28,7 @@ export class InteractiveSessionViewPane extends ViewPane {
private view: InteractiveSessionWidget;
constructor(
interactiveeSessionViewOptions: IInteractiveSessionViewOptions,
interactiveSessionViewOptions: IInteractiveSessionViewOptions,
options: IViewPaneOptions,
@IKeybindingService keybindingService: IKeybindingService,
@IContextMenuService contextMenuService: IContextMenuService,
@@ -40,7 +41,8 @@ export class InteractiveSessionViewPane extends ViewPane {
@ITelemetryService telemetryService: ITelemetryService,
) {
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
this.view = this._register(this.instantiationService.createInstance(InteractiveSessionWidget, interactiveeSessionViewOptions.providerId, this.id, () => 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);
@@ -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);