microsoft / microsoft/vscode-python-debugger

Debug configuration does not override workspace python interpreter

オープン
#463 コメント 4 件 リアクション 1 件 担当者 1 名 GitHub で見る

@eleanorjboyd がすでに取り組んでいます。

2024年9月30日 から。

triage-needed
主要言語
TypeScript
スター
180
フォーク
126
平均マージ
2日 3時間
マージ済み PR(30日)
3

説明

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:

  1. Have a multi-folder/root workspace. E.g.:
    • .vscode
      • launch.json
    • ProjectA
      • projecta-abcd-py3.x
      • etc
    • ProjectB
      • projectb-abcd-py3.x
      • etc
  2. 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": []
        },
    ]
}
  1. 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.
  2. Select the run & debug configuration for a different project. Let's say we select B.
  3. 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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。