-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Node debug attach processId property not accepting custom commands #65566
Comments
@JohnsonMG does it work if you use the command ID directly?
|
Using the command ID directly results in the same error message. Do commands work for you in the processId field? I can't seem to use any commands (apart from PickProcess), let alone my custom one. Like I stated in my original post, the command works for other fields. e.g. I can use it successfully with the "port" parameter. It seems like the processId field specifically has some validation which rejects commands. |
@weinand Does this still need more information? Please advise on what you would like if so. |
@weinand Since there has been no movement on this I decided to poke around and found this: It looks like the attach handler has hardcoded in a check for the string '${command:PickProcess}' rather than running any passed in command. For anyone attempting to do something similar, I got around this by having my custom extension just start a debugging session itself, rather than resolving a string.
Where pick.detail is the showQuickPick result Now instead of starting a debug session, I just run my command from the palette and the debugger attaches automatically. |
The hardcoded check for '${command:PickProcess}' will become obsolete in the January release when we release the new 'resolveDebugConfigurationWithSubstitutedVariables' hook that provides access to substituted variables. Please see #87450. |
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
@connor4312 I have removed the code that resolves command variables (e.g. the process picker) in |
Sounds good, updated js-debug similarly. |
I am using PM2 to run many node processes and want to setup a debug configuration to attach to running processes that were not started in debug mode. As recommended in this feature request I created my own extension to handle this with a custom command that allows me to select a pid from a dropdown.
No matter how simple I make the command however, even just returning a string synchronously, I get the following error:
I have tested this command with other debug configurations (e.g. chrome debugger) and it works totally fine, processId seems to have some type validation which is rejecting it.
Extension package.json
extension.ts:
launch.json:
code --version :
1.30.1
dea8705
x64
node -v:
v8.11.3
ProductName: Mac OS X
ProductVersion: 10.14.2
BuildVersion: 18C54
The text was updated successfully, but these errors were encountered: