microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.04k stars 29.21k forks source link

Debug still doesn't work, probably an indentation problem #152640

Closed ValerioB88 closed 2 years ago

ValerioB88 commented 2 years ago

Issue Type: Bug

Behaviour

def try_this():
    a=[]
    b=[1,2,3]
    for _ in enumerate(b):
    for _ in enumerate(b):
        a.append(3)
try_this()

put a breakpoint in the first line of the try_this() function, that is a=[]. Start debugging and wait until it stops at the breakpoint. Select the whole content of the function and execute it in the debugger. There is no error and all seems to be fine. Then evaluate "a" by typing a in the debug windows. You'll get NameError: name 'a' is not defined, because in fact none of the code has been evaluated.

Expected vs. Actual

The selected code is evaluated in the terminal. a, b will then exist in the debug scope.

Steps to reproduce:

Diagnostic data

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

``` XXX ```

User Settings

``` languageServer: "Pylance" ```

VS Code version: Code 1.68.1 (30d9c6cd9483b2cc586687151bcbcd635f373630, 2022-06-14T12:48:58.283Z) OS version: Windows_NT x64 10.0.19044 Restricted Mode: No Remote OS version: Linux x64 5.4.0-110-generic Remote OS version: Linux x64 5.4.0-110-generic

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz (8 x 1498)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|15.60GB (4.51GB free)| |Process Argv|--folder-uri vscode-remote://ssh-remote%2Bmynet_t/home/ft20308/Saccades --crash-reporter-id f565a944-6500-4aee-b066-94aa1515df0f| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|SSH: mynet_t| |OS|Linux x64 5.4.0-110-generic| |CPUs|AMD Ryzen Threadripper 3990X 64-Core Processor (128 x 2200)| |Memory (System)|125.72GB (0.88GB free)| |VM|0%| |Item|Value| |---|---| |Remote|SSH: mynet_t| |OS|Linux x64 5.4.0-110-generic| |CPUs|AMD Ryzen Threadripper 3990X 64-Core Processor (128 x 2200)| |Memory (System)|125.72GB (0.88GB free)| |VM|0%|
Extensions (19) Extension|Author (truncated)|Version ---|---|--- vscode-babel-coloring|dza|0.0.4 vscode-great-icons|emm|2.1.86 python|ms-|2022.8.0 jupyter-keymap|ms-|1.0.0 remote-ssh|ms-|0.82.1 remote-ssh-edit|ms-|0.80.0 material-icon-theme|PKi|4.18.1 simply-view-image-for-python-debugging|ela|2.2.0 vscode-macros|EXC|1.4.0 vsc-python-indent|Kev|1.16.0 camelcasenavigation|map|1.1.3 python|ms-|2022.8.0 vscode-pylance|ms-|2022.6.20 jupyter|ms-|2022.5.1001601848 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.8 macro|Pie|1.0.1 command-variable|rio|1.36.1 automaton|San|0.0.5 (2 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes516:30244333 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vsdfh931cf:30280410 vshan820:30294714 vstes263:30335439 vscorecescf:30445987 pythondataviewer:30285071 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 vsc1dst:30438360 pythonvs932:30410667 wslgetstarted:30449410 vscscmwlcmt:30465135 cppdebug:30492333 vsclangdc:30486549 ```
weinand commented 2 years ago

/extPython

vscodenpa commented 2 years ago

It looks like this is caused by the Python extension. Please file the issue to the Python extension repository. Make sure to check their issue reporting template and provide them relevant information such as the extension version you're using. See also our issue reporting guidelines for more information.

Happy Coding!