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

Debug: Toggle Auto Attach should change user settings by default, not workspace settings #97087

Closed
Tyriar opened this issue May 6, 2020 · 1 comment · Fixed by #106521
Closed
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues insiders-released Patch has been released in VS Code Insiders polish Cleanup and polish issue

Comments

@Tyriar
Copy link
Member

Tyriar commented May 6, 2020

cc @connor4312

I was confused why the auto attach status bar entry kept disappearing and I kept getting prompts to relaunch my terminals. This was happening because the toggle auto attach command saves a workspace setting, which I never want to commit so it always ends up getting cleared. Auto attach is something I want to toggle on briefly and then toggle off again and I would prefer use the command/keybinding rather than the mouse.

Related: #53640

@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label May 7, 2020
@weinand weinand added this to the September 2020 milestone Sep 9, 2020
connor4312 added a commit that referenced this issue Sep 11, 2020
This PR removes the hook in node-debug's auto attach, and uses only
js-debug auto attach. As referenced in the linked issues, this involves
removing `debug.javascript.usePreviewAutoAttach` and collapsing
`debug.node.autoAttach` into `debug.javascript.autoAttachFilter`. The
latter option gains a new state: `disabled`. Since there's no runtime
cost to having auto attach around, there is now no distinct off versus
disabled state.

The status bar item and the `Debug: Toggle Auto Attach` command now
open a quickpick, which looks like this:

![](https://memes.peet.io/img/20-09-9d2b6c0a-8b3f-4481-b2df-0753c54ee02b.png)

The current setting value is selected in the quickpick. If there is a
workspace setting for auto attach, the quickpick toggle the setting
there by default. Otherwise (as in the image) it will target the user
settings. The targeting is more explicit and defaults to the user
instead of the workspace, which should help reduce confusion (#97087).
Selecting the "scope change" item will reopen the quickpick in that
location.

Aside from the extra options for the `disabled` state in js-debug's
contributions, there's no changes required to it or its interaction
with debug-auto-launch.

Side note: I really wanted a separator between the states and the
scope change item, but this is not possible from an extension #74967.

Fixes #105883
Fixes microsoft/vscode-js-debug#732 (the rest of it)
Fixes #105963
Fixes #97087
@connor4312
Copy link
Member

Referenced in the PR, auto attach now toggles globally by default, except if there's already a workspace setting present that would override it. In both cases, there's a button on the quickpick that you can use to swap into the other scope.

@connor4312 connor4312 added the polish Cleanup and polish issue label Sep 16, 2020
sandy081 pushed a commit that referenced this issue Sep 16, 2020
This PR removes the hook in node-debug's auto attach, and uses only
js-debug auto attach. As referenced in the linked issues, this involves
removing `debug.javascript.usePreviewAutoAttach` and collapsing
`debug.node.autoAttach` into `debug.javascript.autoAttachFilter`. The
latter option gains a new state: `disabled`. Since there's no runtime
cost to having auto attach around, there is now no distinct off versus
disabled state.

The status bar item and the `Debug: Toggle Auto Attach` command now
open a quickpick, which looks like this:

![](https://memes.peet.io/img/20-09-9d2b6c0a-8b3f-4481-b2df-0753c54ee02b.png)

The current setting value is selected in the quickpick. If there is a
workspace setting for auto attach, the quickpick toggle the setting
there by default. Otherwise (as in the image) it will target the user
settings. The targeting is more explicit and defaults to the user
instead of the workspace, which should help reduce confusion (#97087).
Selecting the "scope change" item will reopen the quickpick in that
location.

Aside from the extra options for the `disabled` state in js-debug's
contributions, there's no changes required to it or its interaction
with debug-auto-launch.

Side note: I really wanted a separator between the states and the
scope change item, but this is not possible from an extension #74967.

Fixes #105883
Fixes microsoft/vscode-js-debug#732 (the rest of it)
Fixes #105963
Fixes #97087
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2020
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 insiders-released Patch has been released in VS Code Insiders polish Cleanup and polish issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@weinand @Tyriar @connor4312 and others