GithubHelp home page GithubHelp logo

lmotta / debug_vs_plugin Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 6.0 393 KB

Plugin to Enable Debug for Visual Studio( tested in Visual Studio Code)

License: GNU General Public License v2.0

Python 94.59% Shell 5.41%

debug_vs_plugin's People

Contributors

lmotta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

debug_vs_plugin's Issues

Error with ptvsd

Hi, I have followed the advices :

https://gist.github.com/AsgerPetersen/9ea79ae4139f4977c31dd6ede2297f90

  • Install ptvsd from Qgis 3.10 python env :
    C:\PROGRA~1\QGIS 3.10\apps\Python37>pip install ptvsd==4.1.4

  • Install debugvs plugin

  • Identify plugin folder :
    C:\Users\my_user\Documents\git\QgisCadastrePlugin\cadastre

  • Open this plugin folder with VS Code (right click + open with code)

  • Select python 3.7 from Qgis
    image

  • Create new debug launch.json file like that :

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Attacher",
            "type": "python",
            "request": "attach",
            "connect": {
                "host": "localhost",
                "port": 5678
            },
            "pathMappings": [
                {
                    "localRoot": "${workspaceFolder}",
                    "remoteRoot": "${workspaceFolder}"
                }
            ]
        }
    ]
}

  • I open QGIS and activate Cadastre plugin. Click the debugvs button ang i get this error :

image

  • When i modify debugvs plugin and remove t_ it works :

t_, self.port = self.ptvsd.enable_attach( address = ( self.host, self.port ) )

I could check output text info in VScode but no way to stop process on breakpoint.

Thanks.

Cannot debug processAlgorithm

I don't know why, but it ignores all the breakpoints in processAlgorithm function while others in other functions are fine.
Why is this happening? Is this function being executed in a separate process(operation system process, not QGIS process)?

First load error

Hi,

I try to use this awesome plugin but Qgis can't load it :

SyntaxError: invalid syntax 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 309, in loadPlugin
    __import__(packageName)
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 685, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/pierre/.local/share/QGIS/QGIS3/profiles/default/python/plugins/debug_vs/__init__.py", line 64
    self.iface.addPluginToMenu( f"&{self.nameAction}" , self.action)
                                                    ^
SyntaxError: invalid syntax


Version de Python : 3.5.3 (default, Jul  9 2020, 13:00:10) [GCC 6.3.0 20170516] 
Version de QGIS : 3.4.12-Madeira Madeira, 625767347a 

Have i a version issue ? How to fix it ?

Thanks.

0.8 issues on Mac os

On Mac OS, activating the plugin causes a new instance of QGIS to be run and hangs the original instance. The new instance seems to be running in a more limited environment (no access to saved credentials, e.g.). This did not happen with the ptsd version -- it started immediately with the upgrade to 0.8. I am reverting to 0.7 for now.

QGIS 3.20 segfault (OSX Only)

Hey there.

I just upgraded to QGIS 3.20 and I'm getting a segfault when I try to click the debugvs button. I've tried re-installing the plugin and reinstalling ptvsd using pip but I just can't get it to work.

The plugin seems to still work fine in the LTS version so I'm assuming this is just a problem with QGIS 3.20

Sorry for this sparse bug report but it doesn't seem to give me any good errors. I did notice the terminal popped up when QGIS died and it had the following:

> /Applications/QGIS.app/Contents/MacOS/QGIS ; exit;
Warning: Populating font family aliases took 337 ms. Replace uses of missing font family "FreeSans" with one that exists to avoid this cost. 
proj_create_from_database: SQLite error on SELECT name, type, coordinate_system_auth_name, coordinate_system_code, datum_auth_name, datum_code, area_of_use_auth_name, area_of_use_code, text_definition, deprecated FROM geodetic_crs WHERE auth_name = ? AND code = ?: no such column: area_of_use_auth_name
proj_create_from_database: SQLite error on SELECT name, type, coordinate_system_auth_name, coordinate_system_code, datum_auth_name, datum_code, area_of_use_auth_name, area_of_use_code, text_definition, deprecated FROM geodetic_crs WHERE auth_name = ? AND code = ?: no such column: area_of_use_auth_name
Warning: QWidget::insertAction: Attempt to insert null action
Warning: QWidget::insertAction: Attempt to insert null action
Warning: QWidget::insertAction: Attempt to insert null action
Warning: libpng warning: iCCP: cHRM chunk does not match sRGB
[1]    98328 segmentation fault  /Applications/QGIS.app/Contents/MacOS/QGIS
Saving session...completed.
Deleting expired sessions...       3 completed.

I don't think any of this is related to the problem except for that last line of segfault.

This is a really tricky problem to solve. Let me know if there's more I could do to help with repro steps.

EDIT: Seems like this is happening in OSX and not in windows. I'm going to try a fresh reinstall and see if that fixes it.

breakpoint() defined in code does not trigger

When the plugin is installed and active, standard breakpoint() statements seem to be ignored. Normally one would get a pdb session in the terminal where QGIS was started in. If the plugin is installed, this is not happening.

Not sure if it is a bug or if it is just a missing warning in the documentation.

Breakpoints not triggering

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}"
					}
				]
			},

since 0.8 on Windows QGIS 3.32

2023-08-16T09:11:49 WARNING Traceback (most recent call last):
File "C:\Users/Gerd/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\debug_vs_init_.py", line 131, in enable
if self.debugpy.is_client_connected():
File "C:\Users\Gerd\AppData\Roaming\Python\Python39\site-packages\debugpy\public_api.py", line 28, in wrapper
from debugpy.server import api
File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users\Gerd\AppData\Roaming\Python\Python39\site-packages\debugpy\server\api.py", line 16, in
from pydevd_file_utils import absolute_path
ImportError: cannot import name 'absolute_path' from 'pydevd_file_utils' (C:\OSGeo4W\apps\Python39\lib\site-packages\ptvsd_vendored\pydevd\pydevd_file_utils.py)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.