microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.3k stars 1.18k forks source link

2018.6.0 cannot step into standard library even with experimental python #2039

Closed eedwards-sk closed 5 years ago

eedwards-sk commented 6 years ago

Environment data

Actual behavior

step-into does not step into library code and merely continues

Expected behavior

step-into steps into library code

Steps to reproduce:

  1. pyenv install 3.6.5
  2. pyenv virtualenv -p python3.6 3.6.5 scratch-3.6
  3. open vscode, new workspace, new empty folder
  4. new file -> test.py
  5. test.py:
import argparse

parser = argparse.ArgumentParser()

parser.add_argument( 'foo' )
  1. add debug configuration (python OR python experimental)
  2. add breakpoint at line 5: parser.add_argument( 'foo' )
  3. F5
  4. step-into

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

N\A (nothing!)

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1311  INFO no standard startup: not just one window
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3454 Overwriting grammar scope name to file mapping for scope source.ruby.
Old grammar file: /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ruby/syntaxes/ruby.tmLanguage.json.
New grammar file: /Users/eedwards/.vscode/extensions/rebornix.ruby-0.18.0/syntaxes/ruby.cson.json
Bullenj01 commented 6 years ago

I have the same results using venv and VS Code version 1.25.1 using the Experimental Python debugger. If I create a new default launch.json with the standard debugger file it ignores my break points completely and just runs through the program.

DonJayamanne commented 6 years ago

I can confirm this works in the experimental debugger Please add the setting "debugStdLib": true in your launch.json. Here's the config settings from my launch.json:

        {
            "name": "Python Experimental: Current File (Integrated Terminal)",
            "type": "pythonExperimental",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "debugStdLib": true
        },

Please test with the above settings and let me know how it goes?

Bullenj01 commented 6 years ago

Yes, that did work. Though I think there is still something that has changed in my environment because I have a co-worker running on the same version of VS Code, debugging the same program and he does not have that in his launch.json file. With his, whenever he gets to a "Import" statement it opens up that code being import and you can continue stepping into it. With mine, it now works inside the module(thanks to adding the debugStdLib) but as soon as it hits an import I get an error regarding "Unable to open '':File not found. So I'm looking into that now. I've already done a uninstall/reinstall to try and clear out whatever is breaking it to now avail.

Bullenj01 commented 6 years ago

I think my current issue is something outside of VS Code as I have the same issue with pdb. so setting that variable in launch.json does resolve this issue.

DonJayamanne commented 6 years ago

@Bullenj01 @eedwards-sk It should be fixed, please test the latest development version of the extension. Instructions can be found here https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md#development-build

Almenon commented 5 years ago

Has the fix been released in the latest published version (2018.9.0) yet? I'm guessing not because I'm running into the same error.

brettcannon commented 5 years ago

This has not been supported yet. See #2087 for the issue tracking the fix for this.