Here's a launch.json I got working to debug a Plone Classic add-on that uses runwsgi (you will probably need to change the PYTHONPATH value that I used, in the last line):
It shouldn’t be necessary to activate the virtualenv, since you’re giving the full path to the binary you’re running rather than expecting to find it in $PATH.
I just wanted a run configuration (PyCharm speak), and even with the supplied docs it was clear as mud. The chat thing helped, in a very, very roundabout way. It was like asking a drunk person to help me code... unlikely to work at all.
I would be curious if anyone has successfully used python.analysis.nodeExecutable to get around the fact that pylance crashes hard when one tries to open a source file in your eggs/omelette? Presumably, the 32-bit pointer compression that the bundled V8 that comes with VSCode is the barrier, and running an external node process for pylance to run may avoid this but consume more memory; either way, there’s a lot of symbols to load for all of Plone to be available to the language server.
Thus far, I have just restarted vscode after running into this, or avoided opening the Pandora’s Box of opening any upstream file from Plone itself (by opening things outside my add-ons in vim). At some point, I will try to run pylance in an external nvm-managed node process, but at the moment, I am still limping along.
@ericof I gave up on VS Code. Maybe what I use often in PyCharm is available in VS Code, but I wasn't able to find it, and I just wanted to get stuff done. Maybe one day I will go back and try again.