Nothing happens if the user has installed a wrong python version when debugging on Windows
Describe the bug Same as https://github.com/swiftlang/vscode-swift/issues/627, but this is really a usability issue. It is not mentioned anywhere, that an old python version is required. Then, when you try to debug, you do not get an error message, it just does nothing.
To Reproduce
- Create a hello world app
- Open in VSCode
- F5
- Nothing happens (if you not have a 4 year old python version installed)
Expected behavior An error message that guides the user to install the correct python version
Environment
- OS: Win 11
- Swift version 5.10.1
- Visual Studio Code version: Latest
- vscode-swift version: Latest
What is even more annoying is that the python themselves consider 3.9 and no longer provide an installer for it:
According to the release calendar specified in PEP 596, Python 3.9 is now in the "security fixes only" stage of its life cycle: the 3.9 branch only accepts security fixes and releases of those are made irregularly in source-only form until October 2025. Python 3.9 isn't receiving regular bug fixes anymore, and binary installers are no longer provided for it. Python 3.9.13 was the last full bugfix release of Python 3.9 with binary installers.
https://www.python.org/downloads/release/python-3920/
So this is the latest 3.19 you can download and install https://www.python.org/downloads/release/python-3913/
I believe this is a requirement of the CodeLLDB extension, which the Swift extension relies on to provide a debugger on older Swift versions. The documentation definitely needs to be updated to reflect this requirement.
Once you upgrade to Swift 6 you can "swift.debugger.useDebugAdapterFromToolchain": true in your VS Code User Settings JSON to use the debug adapter included with the Swift 6 toolchains.
Frankly, I'm confused by how lldb-dap works with swift. I installed swift(6.1.2) via swiftly(1.0.1) on Linux and swift extension for VSCode. VSCode doesn't produce any errors after trying to debug a program. Just executing lldb-dap in terminal results in error that libpython3.9 wasn't found. It would be nice if this extension added a warning that user must check if the right python version is available on their machine.
I also couldn't find "swift.debugger.useDebugAdapterFromToolchain" setting
@RocketRide9 swift.debugger.useDebugAdapterFromToolchain has been deprecated for a while. swift.debugger.debugAdapter is the new setting now