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

debuggers.initialConfigurations not calling command #37648

Closed
chrisdias opened this issue Nov 4, 2017 · 3 comments
Closed

debuggers.initialConfigurations not calling command #37648

chrisdias opened this issue Nov 4, 2017 · 3 comments
Assignees
Labels
*as-designed Described behavior is as designed debug Debug viewlet, configurations, breakpoints, adapter issues
Milestone

Comments

@chrisdias
Copy link
Member

Insiders: 1.18.0-insider Commit: 154498 Date: 2017-11-02

The docker extension contributes the following in package.json:

    "debuggers": [
      {
        "type": "docker",
        "label": "Docker Attach",
        "initialConfigurations": "vscode-docker.debug.configureLaunchJson"
      }
    ],

and in the activation of the extension it registers the vscode-docker.debug.configureLaunchJson command:

    ctx.subscriptions.push(vscode.commands.registerCommand('vscode-docker.debug.configureLaunchJson', configureLaunchJson));

When configuring a new workspace the command is not called, instead this is generated:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": "vscode-docker.debug.configureLaunchJson"
}

On Stable the command is executed and the following is generated:

{
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Docker: Attach to Node",
                "type": "node",
                "request": "attach",
                "port": 9229,
                "address": "localhost",
                "localRoot": "${workspaceRoot}",
                "remoteRoot": "/usr/src/app"
            }
        ]
    }

So, its appears broken on Insiders only and is a regression. Not sure how many other extensions do the same contribution.

@chrisdias chrisdias added this to the October 2017 milestone Nov 4, 2017
@vscodebot vscodebot bot added the debug Debug viewlet, configurations, breakpoints, adapter issues label Nov 4, 2017
@ramya-rao-a
Copy link
Contributor

See https://code.visualstudio.com/updates/v1_17#_debug-contributions-in-packagejson debuggers.startSessionCommand, debuggers.initialConfigurations were deprecated in 1.17 and support for them is dropped in 1.18

You need to implement a DebugConfigurationProvider and provide the initial configurations via the provideDebugConfigurations method in it

@weinand
Copy link
Contributor

weinand commented Nov 4, 2017

@chrisdias the deprecation of the initialConfigurations and startSession commands had been already announced in the August release notes: https://code.visualstudio.com/updates/v1_16#_debug-api-updates.

And this information was repeated in the September release notes:
https://code.visualstudio.com/updates/v1_17#_debug-contributions-in-packagejson

Please note: you can still contribute initial launch configs statically in the package.json like this:

   "debuggers": [
      {
        "type": "docker",
        "label": "Docker Attach",
        "initialConfigurations": [
            {
                "name": "Docker: Attach to Node",
                "type": "node",
                "request": "attach",
                "port": 9229,
                "address": "localhost",
                "localRoot": "${workspaceRoot}",
                "remoteRoot": "/usr/src/app"
            }
        ]
      }
    ],

only the somewhat ugly way of specifying a command for the "initialConfigurations" contribution was removed in October.

@weinand weinand closed this as completed Nov 4, 2017
@weinand weinand added the *as-designed Described behavior is as designed label Nov 4, 2017
@chrisdias
Copy link
Member Author

fixed in vscode-docker microsoft/vscode-docker@9f6daa8
also added bug for docs: microsoft/vscode-docs#1237

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed debug Debug viewlet, configurations, breakpoints, adapter issues
Projects
None yet
Development

No branches or pull requests

3 participants