vscode-python: Can't step into code defined in a lib

From @thiagorabelo on September 13, 2017 21:28

Environment data

VS Code version: 1.15.1 Python Extension version: 0.7.0 Python Version: 3.5.2 (in a virtual environment) OS and version: Kubuntu 16.04.3 LTS

Actual behavior

Can’t step into line when this line is in a lib (at least in Django).

visual_code_python

In this example instead of debugger enter in code definition of “get_object_or_404” in file “django/shortcut.py”, in folder “site-package” of virtual environment, it jumps to “_pq_fetch_tuples” method on line 796 in Cursor class in file “psycopg2cffi/_impl/cursor.py” in “site-package” folder of virtual environment.

In same way, instead step into “render” function in “django/shotcuts.py”, jumps to function “urlparse” in “/usr/lib/python3.5/urllib/parse.py” at line 301.

Expected behavior

Enter the appropriate function.

visual_code_python_2

Steps to reproduce:

  • While debugging some block of code, step into a function or method defined in some lib.

Logs

Output from Python output panel
Empty

Output from Console window (Help->Developer Tools menu) Empty

Copied from original issue: DonJayamanne/pythonVSCode#1210

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15

Most upvoted comments

Lol, I’m no longer able to replicate this issue. @thiagorabelo Please could you try debugging using the experimental debugger. All you need to do is:

  • Open launch.json
  • Change "type":"python" to "type":"pythonExperimental"
  • Add the setting "django": true

Here you go:

        {
            "name": "Django",
            "type": "pythonExperimental",
            "request": "launch",
            "stopOnEntry": false,
            "pythonPath": "${config:python.pythonPath}",
            "program": "${workspaceRoot}/manage.py",
            "args": [
                "runserver",
                "--noreload"
            ],
            "django": true
        },

@thiagorabelo I’ve been able to replicate this issue. Thanks, we have what we need at this stage, we’ll keep you posted on the progress of this issue.