microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.65k stars 28.68k forks source link

Chosen user-settings debug launch configuration not remembered #129425

Open bersbersbers opened 3 years ago

bersbersbers commented 3 years ago

I was asked to post this in https://github.com/microsoft/vscode/issues/124770#issuecomment-886668938.

Does this issue occur when all extensions are disabled?: Yes/No

Steps to Reproduce:

  1. Have a launch config in your user settings.json (let' say "Python: Current File", which makes sense in any folder or workspace)
  2. Have a project/.vscode/launch.json with additional launch configs (let's call them "A", "B", "C")
  3. Use a multi-root workspace (not sure this is required, maybe you can skip this)
  4. Select "Python: Current File (user settings)" as the current debug config
  5. Reload Window, OR: Change any setting in any of the launch configurations and save.
  6. Note that launch config "A" is selected.

settings.json:

    "launch": {
        "configurations": [
            {
                "presentation": {
                    "group": "00 Python",
                    "order": 0,
                },
                "name": "Python: Current File",
                "type": "python",
                "request": "launch",
                "program": "${file}",
                "justMyCode": false,
                "subProcess": true,
                "internalConsoleOptions": "openOnSessionStart",
                "console": "internalConsole",
            },
        ],
    },

Related issues: #90216, #100451.

nmoreaud commented 1 week ago

I see this behavior in 2 cases:

Ex: If I have this launch config in my workspace:

    "launch": {
        "configurations": [
            {
                "name": "A", 
                "type": "debugpy",
                "request": "launch",  
                "program": "${file}",
                "justMyCode": true 
            },

and this one in a launch.json:

{
    "version": "0.3.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
        }
    ]
}

If I flip "JustMyCode" boolean, the "Run and Debug" combo box is automatically reset to "Python: Current File".