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

Enable non-debug launches from the configs in launch.json #212826

Closed
seaders opened this issue May 15, 2024 · 2 comments
Closed

Enable non-debug launches from the configs in launch.json #212826

seaders opened this issue May 15, 2024 · 2 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@seaders
Copy link

seaders commented May 15, 2024

Years ago any time I had a project that needed something like a server running, I would figure out the necessary startup of that server, and put it into my `launch.json, most things were node-ish, so they were like this,

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch via NPM",
            "request": "launch",
            "runtimeArgs": [
                "start"
            ],
            "runtimeExecutable": "npm",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "console": "integratedTerminal",
            "type": "node"
        }
    ]
}

That gave me my nice start button in the sidebar, along with the nice output in the debug console window, as well as the nice pause/stop/restart toolbar as well, which I very much liked every bit of.

What I didn't realise, and has wasted literally hours of my time, is that, especially for node, the debugger connects to the build server, and greatly impacts both the build speed, and also is much more resource-intensive than if you just run it from the terminal directly.

The biggest issue then, following on from this is that this occurs whether you set the above console property to something like integratedTerminal as well as manually chose "Start without Debugging" from the menu, instead of just pressing the "Start" button. When you do this, it still opens a "debug" terminal, and then the startup is full of debug options,

/usr/bin/env 'NODE_OPTIONS= --require "/Users/seaders/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/bbash-3.2$  cd <PROJECT_DIR>; /usr/bin/env 'NODE_OPTIONS= --require "/Users/seaders/Applications/Visual Studio Code.app/Contents/Resources/ms-vscode.js-debug/src/bootloader.js"  --inspect-publish-uid=http' 'VSCODE_INSPECTOR_OPTIONS=:::{"inspectorIpc":"/var/folders/pb/y2gc15pj5rsfr3_l2_rpm7m40000gp/T/node-cdp.80854-e78bd6f8-22.sock","deferredMode":false,"waitForDebugger":"","execPath":"/Users/seaders/.nvm/versions/node/v20.11.1/bin/node","onlyEntrypoint":true,"autoAttachMode":"always","fileCallback":"/var/folders/pb/y2gc15pj5rsfr3_l2_rpm7m40000gp/T/node-debug-callback-970ca22e7d9178d9"}' /Users/seaders/.nvm/versions/node/v20.11.1/bin/npm start 

Which is then followed up by Debugger attached..

I've set auto attach to false, in my settings.json,

  "debug.javascript.pickAndAttachOptions": {
    "autoAttachChildProcesses": false
  },

I've also toggled the Debug: Toggle Auto Attach To "Disabled" and it made no difference.

I'm submitting this as a feature request, but the above could also maybe be read as a bug, I'm not sure. I didn't think I was debugging the node build server, I think I've switched every possible setting off, to prevent debugging, as well as chosen to run the thing in the terminal, and "Run Without Debugging", so, for it to be run in a debug mode definitely feels like it might be a bug.

@connor4312
Copy link
Member

You can use the command Debug: Start Without Debugging which will run the config without most of the externalities of the debugger. This should provide you a near zero-overhead way of running your program.

@connor4312 connor4312 added the info-needed Issue requires more information from poster label May 18, 2024
@VSCodeTriageBot
Copy link
Collaborator

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!

@VSCodeTriageBot VSCodeTriageBot closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants