1

I downloaded the Visual Studio Code, but I don't know how to configure the debugger.

I am learning programming and i don't know how to configure it?

someone help me with this problem?

This is what you need to configure.


{
"version": "0.1.0",
// List of configurations. Add new configurations or edit existing ones.  
// ONLY "node" and "mono" are supported, change "type" to switch.
"configurations": [
    {
        // Name of configuration; appears in the launch configuration drop down menu.
        "name": "Launch app.js",
        // Type of configuration. Possible values: "node", "mono".
        "type": "node",
        // Workspace relative or absolute path to the program.
        "program": "app.js",
        // Automatically stop program after launch.
        "stopOnEntry": true,
        // Command line arguments passed to the program.
        "args": [],
        // Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace.
        "cwd": ".",
        // Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH.
        "runtimeExecutable": null,
        // Environment variables passed to the program.
        "env": { }
    }, 
    {
        "name": "Attach",
        "type": "node",
        // TCP/IP address. Default is "localhost".
        "address": "localhost",
        // Port to attach to.
        "port": 5858
    }
]
}
JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
  • What are you trying to debug? I haven't had to configure the debugger in Visual Studio before, it just works. – dub stylee May 22 '15 at 19:17
  • John Papa has some good info on debugging here http://www.johnpapa.net/debugging-with-visual-studio-code/ – Josh C May 22 '15 at 20:00
  • Is this about remote debugging? You need to state your requirements more clearly. – PJTraill May 22 '15 at 22:50
  • check this post to configure Nodejs Express debugging settings http://wiki.workassis.com/nodejs-express-debugging-using-visual-studio-code/ – Bikesh M Aug 19 '16 at 12:20
  • VSCode has an extension -- as listed in an answer in [**this post**](https://stackoverflow.com/questions/29960999/how-to-run-or-debug-php-on-visual-studio-code-vscode?rq=1). – Robert Dewitt Jun 21 '17 at 08:33

2 Answers2

1

You need to be more specific with your question.

What kind of code are you debugging?

Right now Visual Studio Code has debugging support for Node.js (JavaScript and TypeScript) on all platforms, experimental support for mono (C# and F#) on OS X and Linux, and soon ASP.NET 5.

If you are using one of those, you should be able to start using debugging features.

For more information, here is a direct link to the official debugging documentation: https://code.visualstudio.com/Docs/debugging

Tobiah Zarlez
  • 1,680
  • 1
  • 12
  • 13
  • The documentation on how to set up Visual Studio Code for debugging is very poor. Most documentation does not give any information on how to set up the web server, on how to start it automatically when debugging etc... From someone used to regular Visual Studio (and ASP.NET + C#) or Web Matrix + PHP where everything just works (you only have to press **F5** to debug once you have written some code or even no code if your project was based on a template), it is **100** harder to set up Visual Studio code for debugging. – Phil1970 Dec 24 '17 at 03:31
0

If you are coding with php you can follow these step

enter image description here

enter image description here

You can copy and paste code:

"version": "0.2.0",
"configurations": [
    {
        "name": "Listen for XDebug",
        "type": "php",
        "request": "launch",
        "port": 9000
    },
    {
        "name": "Launch currently open script",
        "type": "php",
        "request": "launch",
        "program": "${file}",
        "cwd": "${fileDirname}",
        "port": 9000
    }
]
Uri Goo
  • 101
  • 1