zed icon indicating copy to clipboard operation
zed copied to clipboard

Debugger: pwa-node task shows twice in the debugger

Open jpike88 opened this issue 7 months ago • 6 comments

Summary

On Zed Preview 0.188.2

config:

{
    "adapter": "JavaScript",
    "label": "Debug Server",
    "type": "pwa-node",
    "request": "launch",
    "program": "$ZED_WORKTREE_ROOT/server/dist/app.js",
    "stopOnEntry": false,
    "cwd": "$ZED_WORKTREE_ROOT/server"
  }

Launching this creates TWO items in the debugger process dropdown, and defaults to the one that seems to show zero information in it. I have to switch every time to the other one for there to actually see the launched process console output, it's very frustrating.

Zed Version and System Specs

Image

jpike88 avatar May 25 '25 06:05 jpike88

Thanks, I can reproduce this---we should do better here.

cole-miller avatar May 27 '25 14:05 cole-miller

I just tried to reproduce this on main and realized that the behavior was improved by #31182, which is in the just-released v0.188.3-pre---could you upgrade and check whether the experience is smoother now? Thanks!

cole-miller avatar May 27 '25 15:05 cole-miller

confirmed working on 0.188.3-pre. thanks!

jpike88 avatar May 28 '25 10:05 jpike88

nope I'm wrong. I could have sworn it did the first time, but I still have the issue.

jpike88 avatar May 28 '25 10:05 jpike88

Image Image

jpike88 avatar May 28 '25 10:05 jpike88

After updating zed preview...

Image

The child is the process I actually care about.

Also can you take another look at the other debugger related issues I raised this week?

jpike88 avatar May 30 '25 02:05 jpike88

I think we're going to continue having two sessions in the list here, since that reflects the underlying reality. Eventually it would be great to have a tree display to represent the parent/child relationships. However, we should now be automatically switching you to the child session so that the debugging experience is smooth---let me know if that's not the case!

cole-miller avatar Jun 05 '25 17:06 cole-miller

VSCode just shows one session... Node developers are generally high-level programmers and will easily get confused when seeing two processes at the same time, even if it becomes a tree. I'd suggest some kind of flag that can expose these kind of parent processes for advanced usage... %99.99 of the time no node developer's going to care about the distinction.

That's probably the same for python, go devs too. It's too low-level to expose to people using those particular adapters.

And for me, who will want to juggle two active debugging sessions (server and client) it'll just potentially get in the way.

jpike88 avatar Jun 05 '25 18:06 jpike88

This isn't what I'd call good UX. Those "Debug Server/Client" options are kind of useless on their own.

Image Image

I suggest when only one child process is fired up from the debugger, combine the debugger process and child process into one option.

So "Debug Server" would actually be the app.js, renamed.

If people want to force them to show separately, make that an opt-in setting. It's an advanced mode as almost 0% of people are going to be juggling multiple node.js/chrome instances under their debugging session.

jpike88 avatar Jun 12 '25 02:06 jpike88

edit: I thought something else was broken, dw about it

jpike88 avatar Jun 12 '25 03:06 jpike88

closing issue as out of date.

I'll re-paste my feedback:

"I suggest when only one child process is fired up from the debugger, combine the debugger process and child process into one option.

So "Debug Server" would actually be the app.js, renamed.

If people want to force them to show separately, make that an opt-in setting. It's an advanced mode as almost 0% of people are going to be juggling multiple node.js/chrome instances under their debugging session."

jpike88 avatar Jun 20 '25 04:06 jpike88