From 2405c6c6e98214359a8367e8c1d605bcf47d990c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Tue, 7 Nov 2023 18:00:25 +0100 Subject: [PATCH] feat: add a way to make any part hidden --- src/service-override/layout.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/service-override/layout.ts b/src/service-override/layout.ts index 551ee776..d9dbd6b0 100644 --- a/src/service-override/layout.ts +++ b/src/service-override/layout.ts @@ -192,7 +192,7 @@ export class LayoutService implements ILayoutService, IWorkbenchLayoutService { return viewContainerModel.activeViewDescriptors.length >= 1 } - setPartHidden (hidden: boolean, part: Exclude): void { + setPartHidden (hidden: boolean, part: Parts): void { if (hidden) { this.hiddenParts.add(part) } else { @@ -226,14 +226,10 @@ export class LayoutService implements ILayoutService, IWorkbenchLayoutService { void this.paneCompositeService.openPaneComposite(panelToOpen, location, true) } } - - // The code that show or hide parts in vscode is not pulled by this library, so let's do it by hands here - // eslint-disable-next-line @typescript-eslint/no-explicit-any - if ((this.paneCompositeService as any).getPartByLocation != null) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this.paneCompositeService as any).getPartByLocation(location).setVisible(!hidden) - } } + + // The code that show or hide parts in vscode is not pulled by this library, so let's do it by hands here + this.getPart(part).setVisible(!hidden) } isVisible (part: Parts): boolean {