Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close Debug Console completly (if merged with other panels) #148616

Closed
gitter-me opened this issue May 3, 2022 · 7 comments · Fixed by #151535
Closed

Close Debug Console completly (if merged with other panels) #148616

gitter-me opened this issue May 3, 2022 · 7 comments · Fixed by #151535
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@gitter-me
Copy link

I have merged the debug console, variables and watch panels at the bottom.
sample

I have also debug.console.closeOnEnd active.

If I stop the debugger the debug console collapes instead of closing the whole bottom panel

sample2

(If debug console is the only panel the whole bottom area closes.)

I' not sure if the behaviour is a bug or by design? Or is there already a setting to control this?
Otherwise a settings would be great if it should be collapsed or closed.

What I want to have is more a less: on debug start to open the bottom with all debug panels side-by-side and on exit debug to close the whole bottom area.

I already use "debug.internalConsoleOptions" with "openOnSessionStart" and
"debug.console.closeOnEnd"

Side note: I'm not too happy with the Run and Debug area on the left side, because after debugging I have to switch back to Explorer view and I'm constantly resizing the left side, because for debug the width is too small and for explorer then it is too wide.

@roblourens roblourens added feature-request Request for new features or functionality debug Debug viewlet, configurations, breakpoints, adapter issues labels May 3, 2022
@roblourens roblourens added this to the Backlog milestone May 3, 2022
@roblourens
Copy link
Member

roblourens commented May 3, 2022

Fair feature request, it feels weird to hide other unrelated views as a result of this setting, but the user opted in to it and I can't imagine anyone actually wants the current behavior.

@sbatten currently I call IViewsService#closeView. If I want to close the panel here, is there a way to find the parent view container and call closeViewContainer?

I'm not too happy with the Run and Debug area on the left side, because after debugging I have to switch back to Explorer view and I'm constantly resizing the left side, because for debug the width is too small and for explorer then it is too wide.

Yeah, currently it can't be moved. You might try putting it in the "secondary side bar" if that helps, then you can have it a different size although on the other side of the screen. Sorry, currently the explorer and debug views currently can't be moved to the secondary side bar

@sbatten
Copy link
Member

sbatten commented May 3, 2022

@roblourens you can use the IViewDescriptorService to get any information you need. e.g. the ViewContainer will tell you its in Debug. The View Container Location can tell you which Part it is in.

@roblourens
Copy link
Member

Thanks. I'm confused about what I'm seeing though. I think I want to check whether the Debug Console view is inside the Debug Console view container (and not the debug sidebar or somewhere else). So I call this.viewDescriptorService.getViewContainerByViewId(REPL_VIEW_ID); and get back a View Container that has this id: 'workbench.views.service.panel.16bc7ee5-d929-4163-8a42-9ce36fe79429' but I registered the view container with the id 'workbench.panel.repl', that happened here:

const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
id: DEBUG_PANEL_ID,
title: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, 'Debug Console'),
icon: icons.debugConsoleViewIcon,
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [DEBUG_PANEL_ID, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }]),
storageId: DEBUG_PANEL_ID,
hideIfEmpty: true,
order: 2,
}, ViewContainerLocation.Panel, { donotRegisterOpenCommand: true });

Am I doing something wrong? I see another view container in the ViewContainersRegister (this is viewContainersRegistry.all)
image

@sbatten
Copy link
Member

sbatten commented May 16, 2022

@roblourens please Reset View Locations and try reproducing again. The container id that you see suggests that you're debug panel view has been moved out of its original container.

@roblourens
Copy link
Member

roblourens commented May 16, 2022

It works after that. But then I rearrange views a little more and it gets the ID with the GUID again. It looks like this but I'm getting the guid view container id.

image

I'm not sure whether it matters though, I guess I'm still trying to decide what the behavior should be.

@gitter-me do you think that the full panel should always close in this case? If I drag the debug console into the problems panel, should it close? Only when the title of the panel is Debug Console?

@gitter-me
Copy link
Author

@roblourens if you for example drag the debug console to the right of the problems panel the tab is labeled "problems", dragged to the left its called "debug console"

If you check for the tab title the usability gets a little bit complicated: To achieve what the settings suggest, you have to make sure the debug console is placed in a way that the tab reflect its name (in other words it must be the first on the left). Also this would be also a brittle implementation, if the tab naming logic or display text changes in the future. For this two reasons I would not use the title of the panel.

I would close the bottom panel if the debug console is a visible child of the active panel (or if debug console is the only active panel [nothing grouped together] )
In your example, if the setting is active and you drag debug console into the problems, the whole panel should close.

@roblourens roblourens modified the milestones: Backlog, June 2022 Jun 8, 2022
@roblourens
Copy link
Member

I think we can just go with the logic of closing whatever view container the debug console is currently in. Makes sense to keep it simple because the user configured their views this way, and they changed the default of the setting to close the debug console, and if they don't like it they can reset that setting. Also consistent with the existing internalConsoleOptions setting which can show the debug console on session start, wherever it is.

roblourens added a commit that referenced this issue Jun 8, 2022
…has been moved to another view.

Close whichever view container contains the debug console.
Fixes #148616
roblourens added a commit that referenced this issue Jun 8, 2022
…has been moved to another view. (#151535)

Close whichever view container contains the debug console.
Fixes #148616
@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jun 8, 2022
@roblourens roblourens added the verification-needed Verification of issue is requested label Jun 28, 2022
@alexr00 alexr00 added the verified Verification succeeded label Jun 29, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jul 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
5 participants