Skip to content

Commit 0f932a4

Browse files
committed
Added PTVSD Version Warning
- Added documentation about ptvsd version and link to the related visual studio docs.
1 parent 977fc79 commit 0f932a4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Blender Debugger for VS Code
1+
# Blender Debugger for VS Code
22

33
Inspired by [Blender-VScode-Debugger](https://github.com/Barbarbarbarian/Blender-VScode-Debugger) which was itself inspired by this [remote_debugger](https://github.com/sybrenstuvel/random-blender-addons/blob/master/remote_debugger.py) for pycharm as explained in this [Blender Developer's Blog post](https://code.blender.org/2015/10/debugging-python-code-with-pycharm/).
44

@@ -8,6 +8,7 @@ Since the VS Code one wasn't really well documented and it looked kind of dead,
88
Now it can:
99

1010
- Auto-detect where python is and auto set the path to ptvsd if installed.
11+
- Warn you if you installed the wrong ptvsd version (for VS Code, for Visual Studio it should still work)
1112
- Tell you when the debugger has actually attached.
1213

1314
![Image Showing VS Code side by side with Blender paused at a breakpoint. In the console, a "Debugger is Attached" Statement is printed.](./Example.png)
@@ -29,7 +30,8 @@ Install Python 3 with pip and check add to PATH.
2930
- If you already have python installed and you can run it from the command line (aka PATH is set), the addon should find it. It uses `where python` or `whereis python` or `which python` depending on the OS to determine where python is. I only have windows at the moment, so only that is tested, but it should work.
3031

3132
`pip install ptvsd==3.0.0`
32-
- Newer versions do not work, you will just get an error in VS Code trying to connect. later versions aren't supported yet see [Debugging Python with VS Code](https://code.visualstudio.com/docs/python/debugging#_remote-debugging) and [#514](/Microsoft/vscode-python/issues/514).
33+
- Newer versions will not work, the add-on will warn you in the console if the version is above 3.0.0. Later versions aren't supported yet in VS Code, and it will throw an error when trying to connect. See [Debugging Python with VS Code](https://code.visualstudio.com/docs/python/debugging#_remote-debugging) and [#514](/Microsoft/vscode-python/issues/514).
34+
- For Visual Studio, later versions should work depending on the Visual Studio version. I have never used Visual Studio, but you can find more info on setting everything up here: [Remotely Debugging Python Code on Linux](https://docs.microsoft.com/en-us/visualstudio/python/debugging-python-code-on-remote-linux-machines#connection-troubleshooting). (it is not Linux specific)
3335

3436
## Setting up your Addon
3537

__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
bl_info = {
22
'name': 'Debugger for VS Code',
33
'author': 'Alan North',
4-
'version': (0, 0, 2),
4+
'version': (0, 1, 0),
55
'blender': (2, 79, 0),
66
"description": "Starts debugging server for VS Code.",
77
'location': 'In search (default shortcut:space) type "Debug"',
@@ -157,6 +157,10 @@ def execute(self, context):
157157
global ptvsd #so we can do check later
158158
import ptvsd
159159

160+
version = re.sub("\.", "", ptvsd.__version__)
161+
if int(version) > 3000:
162+
print("Warning: PTVSD version " + ptvsd.__version__ + " is greater than 3.0.0, it will not work with VS Code.")
163+
160164
# can only be attached once, no way to detach (at least not that I understand?)
161165
try:
162166
ptvsd.enable_attach("my_secret", address = ("0.0.0.0", 3000))

0 commit comments

Comments
 (0)