lmotta / debug_vs_plugin

Plugin to Enable Debug for Visual Studio( tested in Visual Studio Code)
GNU General Public License v2.0
20 stars 8 forks source link

Breakpoints not triggering #6

Closed MattReimer closed 3 years ago

MattReimer commented 3 years ago

Hey. This is a great little plugin but I can't get the breakpoints to fire for the life of me. Really hoping this is something simple.

Currently on Windows 10 and I'm executing VSCode using a batch file to set up the environment correctly:

@echo off
call "%QGIS_ROOT%\bin\o4w_env.bat"
call "%QGIS_ROOT%\bin\py3_env.bat"
call "%QGIS_ROOT%\bin\qt5_env.bat"

set VSI_CACHE=TRUE
set VSI_CACHE_SIZE=1000000

pushd %~dp0
call "%VSCODE_ROOT%\code.cmd" Windows.code-workspace

I've got the debuger attaching ok and the DEBUG CONSOLE is showing my print('hello world') statements but my breakpoints don't trigger and they are greyed out.

pythondebug

Here's my launch profile:

            {
                "name": "QGIS DebugS",
                "type": "python",
                "request": "attach",
                "port": 5678,
                "host": "localhost",
                "pathMappings": [
                    {
                        "localRoot": "${workspaceFolder}",
                        "remoteRoot": "${workspaceFolder}"
                    }
                ]
            },
lmotta commented 3 years ago

Hi,

Possibly, you saw the Plugin's Wiki[1] , where, show the dependencies, how "ptvsd" and the config file (launch.json).

Please, remove the "pathMappings" in yours launch.json.

My launch.json is: { "version": "0.2.0", "configurations": [ { "name": "Python: QGIS Debugger", "type": "python", "request": "attach", "host": "localhost", "port": 5678 }, ]

The steps: 1) Run Plugin in QGIS 2) Run "QGIS Debugger" in VSCODE If all is right, you can see the tools of debug in VSCODE.

I hope you can have success.

[1] https://github.com/lmotta/debug_vs_plugin/wiki

MattReimer commented 3 years ago

Worked Thank you!