microsoft / vscode-python-debugger

Python debugger (debugpy) extension for VS Code.
https://marketplace.visualstudio.com/items?itemName=ms-python.debugpy
MIT License
41 stars 17 forks source link

Error on clicking `Run and Debug` on the current Python file #231

Closed aiday-mar closed 4 months ago

aiday-mar commented 4 months ago

When in a Python file and choosing the option Run and Debug, then Python file, I see the view to the left change UI as it appears that the debugger is selected and then removed. I am not sure what is happening. I suppose if there was an issue with the given debugger I would have expected a notification.

When I open the developer tools, I see the following error:

ERR Invalid debug adapter: Error: Invalid debug adapter
    at h.p (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1876:95)
    at h.$acceptDAExit (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1876:35)
    at g.S (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1608:13967)
    at g.Q (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1608:13733)
    at g.M (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1608:12826)
    at g.L (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1608:12044)
    at l.value (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1608:10692)
    at o.y (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:87:1902)
    at o.fire (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:87:2119)
    at r.fire (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:624:14439)
    at j.onmessage (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1631:7759)

https://github.com/microsoft/vscode-python-debugger/assets/61460952/75b3be05-dd94-41e3-abfd-39fcd06a6a0b

paulacamargo25 commented 4 months ago

thanks @aiday-mar, that is the normal behavior, when you click run and debug, it will debug your code once and then close debug, since you are not calling the function, the debug does not have any code to run, for that closes immediately.

Can you try a function that does something and set breakpoints?

aiday-mar commented 4 months ago

Hi @paulacamargo25 I see thanks, yes it works with a file that has proper code to run, I will then close the issue.