lmotta / debug_vs_plugin Goto Github PK
View Code? Open in Web Editor NEWPlugin to Enable Debug for Visual Studio( tested in Visual Studio Code)
License: GNU General Public License v2.0
Plugin to Enable Debug for Visual Studio( tested in Visual Studio Code)
License: GNU General Public License v2.0
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)
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}"
}
]
}
]
}
t_
it works :Line 80 in 291b9b9
I could check output text info in VScode but no way to stop process on breakpoint.
Thanks.
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)?
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.
it currently seems incomplete.
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.
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.
Thank you for making this plugin.
I had some trouble getting it to work with QGIS on my mac, so I wrote a little description of what I did to make it work: https://gist.github.com/AsgerPetersen/9ea79ae4139f4977c31dd6ede2297f90
As someone noticed on that GIST it would make sense to include the description with the plugin. You are welcome to copy from the text if you like.
https://github.com/lmotta/debug_vs_plugin/wiki, the image shown as broken...
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.
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.
Here's my launch profile:
{
"name": "QGIS DebugS",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "${workspaceFolder}"
}
]
},
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)
It currently points to the repo, not to the issues page.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.