Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI Run button does not use launch.json configs properly #22465

Closed
JackCaster opened this issue Nov 13, 2023 · 1 comment
Closed

UI Run button does not use launch.json configs properly #22465

JackCaster opened this issue Nov 13, 2023 · 1 comment
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@JackCaster
Copy link

JackCaster commented Nov 13, 2023

Type: Bug

Behaviour

Expected vs. Actual

I want to debug a Python module. One debug configuration is set to run the module ("Python: Module"), but I also have other configurations (e.g., "Python: Current File"). In the Run and debug section, I can select one of the configuration and launch it with the shortcut F5 or from the menu Run > Start debugging. The button on the upper right side of the UI, instead, will not pick up the currently selected configuration. It will only use the first configuration with the purpose "debug-in-terminal", in this case "Python: Module"

Steps to reproduce:

I created a launch.json file like

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true
        },
        {
            "name": "Python: Module",
            "type": "python",
            "request": "launch",
            "module": "<your module name>",
            "justMyCode": true,
            "purpose": [
                "debug-in-terminal"
            ]
        }
    ]
}

Now, I can select one of the two configurations in the Run and debug window and launch it via F5 or Run > Start debugging. Instead, the run button will always run the "Python: Module" one, regardless of which one I select in the drop-down menu. If I add

 "purpose": [
                "debug-in-terminal"
            ]

also to the "Python: Current File" configuration, that's the one that will be always run.

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.12
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Global
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings


languageServer: "Pylance"

testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true

Extension version: 2023.20.0
VS Code version: Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:51:52.184Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Nov 13, 2023
@karthiknadig
Copy link
Member

Duplicate of #11812

@karthiknadig karthiknadig marked this as a duplicate of #11812 Nov 13, 2023
@karthiknadig karthiknadig closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants