How to disable "just my code" setting in VSCode debugger?

Visual Studio-CodeVscode Debugger

Visual Studio-Code Problem Overview


When starting my project in the debugger (C# .NET Core), it states it's debugging "just my code".

I want to also debug the libraries, and can't see a setting to disable this anywhere in VSCode.

Is it possible to disable?

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

For this you need to change the launch.json file. Inside the launch.json file you have to set "justMyCode" to false.

As described here. (I was pointed to that link through this post on the Visual Studio Code site.)

Solution 2 - Visual Studio-Code

Just adding "justMyCode": false to launch.json doesn't work. You need to add a separate config in launch.json like below. FYI each {} represents a config.

"configurations": [
        {
           .... # existing config
        },
        {
            "name": "Debug Unit Test",
            "type": "python",
            "request": "test",
            "justMyCode": false,
        }
    ]

As pointed out in here

Solution 3 - Visual Studio-Code

VSCode 1.60 was complaining about the "request": "test" method suggested by others.

But I did have to add a new section below my existing configuration to get "justMyCode": false to work.

Here is what worked for me:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        

        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "args": [
                "blah",
                "whatever"
            ]
        },
        {
            "name": "Python: Debug Unit Tests",
            "type": "python",
            "request": "launch",
            "purpose": ["debug-test"],
            "console": "integratedTerminal",
            "justMyCode": false,
        }
    ]
}

The purpose addition appears to be important.

I found the correct approach documented here: https://code.visualstudio.com/docs/python/testing#_debug-tests

Solution 4 - Visual Studio-Code

If you're specifically debugging Python unit tests, adding "justMyCode": "false" to your normal config won't do, you'll need to add another in your launch.json with "request": "test":

        {
            "name": "Debug Unit Test",
            "type": "python",
            "request": "test",
            "justMyCode": false,
        },

Source: Github Microsoft/vscode-python Issue #7131

Solution 5 - Visual Studio-Code

In the documenentation of Visual Studio Code they have a section "Skipping uninteresting code".

> VS Code Node.js debugging has a feature to avoid source code that you don't want to step through (AKA 'Just My Code').
This feature can be enabled with the skipFiles attribute in your launch configuration. skipFiles is an array of glob patterns for script paths to skip.

In your launch.json file you have to add (or any other file you want to skip):

  "skipFiles": [
    "${workspaceFolder}/node_modules/**/*.js",
    "${workspaceFolder}/lib/**/*.js"
  ]

Solution 6 - Visual Studio-Code

I added the "justMyCode": false" setting to launch.json and it still didn't stop at breakpoints in external library code. What was even more confusing: It did work for once and then suddenly it didn't anymore.

Then I found out: If you are in the "Run and Debug (SHIFT+CMD+D)"-tab and select your configuration there and click the green triangle / "Start Debugging (F5)" it works! However, if I click "Debug Python File" in the upper right corner it does not stop in external library code!

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRevolt64View Question on Stackoverflow
Solution 1 - Visual Studio-CodeGeshodeView Answer on Stackoverflow
Solution 2 - Visual Studio-CodeTenzin -View Answer on Stackoverflow
Solution 3 - Visual Studio-CodewarrensView Answer on Stackoverflow
Solution 4 - Visual Studio-CodeDlean JeansView Answer on Stackoverflow
Solution 5 - Visual Studio-CodeHypenateView Answer on Stackoverflow
Solution 6 - Visual Studio-CodekikoView Answer on Stackoverflow