Skip to content

Commit

Permalink
debug: use only js-debug auto attach, collapse settings
Browse files Browse the repository at this point in the history
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
  • Loading branch information
connor4312 committed Sep 11, 2020
1 parent 69ffb6b commit 575a3c9
Show file tree
Hide file tree
Showing 3 changed files with 222 additions and 240 deletions.
33 changes: 6 additions & 27 deletions extensions/debug-auto-launch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,6 @@
"watch": "gulp watch-extension:debug-auto-launch"
},
"contributes": {
"configuration": {
"title": "Node debug",
"properties": {
"debug.node.autoAttach": {
"scope": "window",
"type": "string",
"enum": [
"disabled",
"on",
"off"
],
"enumDescriptions": [
"%debug.node.autoAttach.disabled.description%",
"%debug.node.autoAttach.on.description%",
"%debug.node.autoAttach.off.description%"
],
"description": "%debug.node.autoAttach.description%",
"default": "disabled"
},
"debug.javascript.usePreviewAutoAttach": {
"scope": "window",
"type": "boolean",
"default": true,
"description": "%debug.javascript.usePreviewAutoAttach%"
}
}
},
"commands": [
{
"command": "extension.node-debug.toggleAutoAttach",
Expand All @@ -57,5 +30,11 @@
},
"devDependencies": {
"@types/node": "^12.11.7"
},
"prettier": {
"printWidth": 100,
"trailingComma": "all",
"singleQuote": true,
"arrowParens": "avoid"
}
}
7 changes: 0 additions & 7 deletions extensions/debug-auto-launch/package.nls.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
{
"displayName": "Node Debug Auto-attach",
"description": "Helper for auto-attach feature when node-debug extensions are not active.",

"debug.node.autoAttach.description": "Automatically attach node debugger when node.js was launched in debug mode from integrated terminal.",
"debug.javascript.usePreviewAutoAttach": "Whether to use the preview debugger's version of auto attach.",
"debug.node.autoAttach.disabled.description": "Auto attach is disabled and not shown in status bar.",
"debug.node.autoAttach.on.description": "Auto attach is active.",
"debug.node.autoAttach.off.description": "Auto attach is inactive.",

"toggle.auto.attach": "Toggle Auto Attach"
}
Loading

0 comments on commit 575a3c9

Please sign in to comment.