microsoft / microsoft/vscode-python-debugger
Debug configuration does not override workspace python interpreter
Đang mở
@eleanorjboyd đang làm issue này rồi.
Từ ngày 30/9/2024.
triage-needed
- Ngôn ngữ chính
- TypeScript
- Star
- 180
- Fork
- 126
- Merge trung bình
- 2 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 3
Mô tả
Fairly straightforward issue. When performing "Start Debugging" or "Run Without Debugging", the debugger will use the current workspace interpreter instead of the interpreter specified in the launch.json configuration with the "python" key.
Steps to reproduce:
- Have a multi-folder/root workspace. E.g.:
- .vscode
- launch.json
- ProjectA
- projecta-abcd-py3.x
- etc
- ProjectB
- projectb-abcd-py3.x
- etc
- .vscode
- Specify the interpreter you want each debug configuration to use in your launch.json file. E.g.:
{
"version": "0.2.0",
"configurations": [
{
"name": "ProjectA",
"type": "debugpy",
"python": "${workspaceFolder}/projectA/projecta-abcd-py3.x/bin/python",
"request": "launch",
"program": "${workspaceFolder}/projectA/cli.py",
"console": "integratedTerminal",
"args": []
},
{
"name": "ProjectB",
"type": "debugpy",
"python": "${workspaceFolder}/ProjectB/projectb-abcd-py3.x/bin/python",
"request": "launch",
"program": "${workspaceFolder}/ProjectB/cli.py",
"console": "integratedTerminal",
"args": []
},
]
}
- Set your workspace interpreter to the interpreter for any project. Let's say we set it to A,
./projectA/projecta-abcd-py3.x/bin/python. - Select the run & debug configuration for a different project. Let's say we select B.
- Start Debugging or Run Without Debugging.
Expected result (terminal output):
source /home/REDACTED/ProjectB/projectb-abcd-py3.x/bin/activate
user@host:~/REDACTED$ source /home/REDACTED/ProjectB/projectb-abcd-py3.x/bin/activate
(projectb-py3.x) user@host:~/REDACTED$ /usr/bin/env /home/REDACTED/ProjectB/projectb-abcd-py3.x/bin/python /home/REDACTED/.vscode-server/extensions/ms-python.debugpy-2024.10.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 41261 -- /home/REDACTED/ProjectB/cli.py
Actual result (terminal output):
source /home/REDACTED/ProjectA/projecta-abcd-py3.x/bin/activate
user@host:~/REDACTED$ source /home/REDACTED/ProjectA/projecta-abcd-py3.x/bin/activate
(projecta-py3.x) user@host:~/REDACTED$ /usr/bin/env /home/REDACTED/ProjectA/projecta-abcd-py3.x/bin/python /home/REDACTED/.vscode-server/extensions/ms-python.debugpy-2024.10.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 41261 -- /home/REDACTED/ProjectB/cli.py
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Đánh giá
Issue này chưa được đánh giá.