1

I noticed that the debug mode in VS Code uses the launch.json "program" entry to decide which file to launch.

Is there any way to bypass this ? I would like to just like right-click and debug a specific file in my Node App. As of now, I have to go edit launch.json everytime I am debugging a new js file.

"configurations": [

        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${workspaceRoot}\\hello.js"
        }

1 Answer 1

2

VS Code currently does not support debugging by right clicking on file. The closest alternative you can have is debugging the currently opened file, set your program property to ${file} in your launch.json:

{
    // ...
    "program": "${file}"
}

See this link for a list of available variables you can use in launch.json

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.