Edit: Slightly cleaner solution:
Don't make a separate workspace for your code (unless you want it, in which case mostly follow the guide below), and instead of putting a .vscode
folder in the parent
root folder, open up the workspace launch config from the Run and Debug menu on the left. Make it look something like this:
{
"folders": [
{
"path": "%path to parent%/parent"
}
],
"settings": {},
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "Launch Python parent",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}\\extensions\\mycode", // <-- Important
"env": {"PYTHONPATH": "${workspaceFolder}; ${workspaceFolder}\\extensions\\mycode; ${env:PYTHONPATH}"} // <-- Important
}
]
}
}
Not much cleaner, but you don't have to modify the parent project or set up multiple workspaces.
Not so much a question, but a solution to the very specific problem I had. Might be a duplicate of