Skip to content

Inconsistent behavior with compound configurations depending on both settings.json and launch.json configurations #77782

Closed

Description

@damolina-stripe
  • VSCode Version: 1.36.1
  • OS Version: MacOS 10.14.5

Scenario
Extension user reported a problem with a compound configuration not working correctly with a custom extension using vscode.debug.startDebugging. The extension creates a command that sets up the debugging environment (e.g. starts services) before launching a given debug configuration by name.

Steps to Reproduce

  1. Create a new workspace (any target should do).

  2. Define a configuration structure similar to this:

settings.json

...
"launch": {
  "configurations": [
    { "name": "Config_A", ... }
  ],
  "compounds": [
     { name: "Compound", "configurations": [ "Config_A", "Config_B" ] }
  ]
}
...

launch.json

...
"configurations": [
  { name: "Config_B" , ...  }
]
...
  1. From the Debug drop down, select "Compound" and run.
    This works.

  2. Create an extension that runs this line (a workspace must be loaded): vscode.debug.startDebugging(vscode.workspace.workspaceFolders[0], 'Compound')
    This fails with "Configuration 'Compound' is missing in 'launch.json'".

Questions

  1. Should step 2 (run from drop down) work? It seems to me it should not:

    • According to this page: https://code.visualstudio.com/Docs/editor/debugging, Tip: If a workspace contains a "launch.json", the global launch configuration is ignored.

    • According to WorkspaceConfiguration.inspect documentation, local values (launch.json) should override global (settings.json). This works strictly as documented. For the provided repro: Workspace.getConfiguration('launch').get('configuration') only returns configurations in launch.json (i.e. arrays are not merged), Workspace.getConfiguration('launch').get('compounds') only returns compound configurations in settings.json (i.e. because launch.json does not define a compounds value). Using WorkspaceConfiguration.inspect I can verify all configuration values exists and are overriden as intended.

  2. If Step 2 should work, how to run step 3? i.e. how to use vscode.debug.startDebugging to call 'compound' successfully?

  3. If step 3 should not work, neither should step 2. Correct?

Activity

  1. isidorn commented on Oct 17, 2019

    @isidorn
    1. Should work. Since the docs mention if you add your launch config in the user settings. In your steps you are adding it to the workspace settings. And it is expected that this works/
    2. vscode.debug.startDebugging also works with compounds. However it is not possible to reference compounds in your workspace settings and then to be called from this command.

    The issue seems to be here .

    Since you want 3) I will rename this issue and it is a fair feature request, which we do not currently plan to tackle.
    Thanks

  2. added
    feature-requestRequest for new features or functionality
    and removed
    under-discussionIssue is under discussion for relevance, priority, approach
    on Oct 17, 2019
  3. damolina-stripe commented on Oct 18, 2019

    @damolina-stripe
    Author

    The idea would be for vscode.debug.startDebugging to have behavior parity with the Debug dropdown, whatever the proper behavior happens to be. Extension users see it as an extension bug when behavior is not equivalent.
    Having said that, it is not a P1 bug for sure but would it be possible to update documentation to call out this difference?

  4. isidorn commented on Oct 18, 2019

    @isidorn

    I agree that there should be parity. And we will aim for this.
    I think updating docs makes sense and we accept PRs in our vscode-docs repository https://github.com/microsoft/vscode-docs

  5. vscodebot commented on Jan 15, 2020

    @vscodebot

    This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

    Happy Coding!

  6. vscodebot commented on Mar 6, 2020

    @vscodebot

    This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

    Happy Coding

  7. vscodebot commented on Mar 6, 2020

    @vscodebot

    This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

    Happy Coding

  8. vscodebot commented on Mar 16, 2020

    @vscodebot

    🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

    Happy Coding!

  9. locked and limited conversation to collaborators on Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

debugDebug viewlet, configurations, breakpoints, adapter issuesfeature-requestRequest for new features or functionality

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions