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

Debug -> Start Debugging doesn't work without a launch.json #6489

Open
DanTup opened this issue Nov 4, 2019 · 2 comments
Open

Debug -> Start Debugging doesn't work without a launch.json #6489

DanTup opened this issue Nov 4, 2019 · 2 comments
Labels
debug issues that related to debug functionality

Comments

@DanTup
Copy link
Contributor

DanTup commented Nov 4, 2019

If I create a .dart file and install the Dart extension, I can debug it if I create a launch.json file like this:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Dart",
      "request": "launch",
      "type": "dart"
    }
  ]
}

However if there is no launch.json, then Start -> Start Debugging does nothing (it doesn't even show a message to indicate why).

In VS Code, when there's no launch.json, VS Code will use the open file to decide which debugger to use (and if there's no open file, it will prompt the user to pick from a list of all debuggers). This is generally how we encourage Dart/Flutter users to run (only creating a launch.json if they need to customise something).

@vince-fugnitto vince-fugnitto added the debug issues that related to debug functionality label Nov 4, 2019
@vince-fugnitto
Copy link
Member

@DanTup I have a partial fix #6490. More effort will be required to prompt users for different debug types through the quick-open however.

@DanTup
Copy link
Contributor Author

DanTup commented Nov 4, 2019

Ok great. FWIW, VS Code doesn't just create a launch.json, it can launch without one (which is preferred, because otherwise people have to maintain it). Whether it creates one depends on the return value from resolveDebugConfiguration (null causes launch.json to be created and opened, undefined is silent, and anything else will launch - see https://github.com/Dart-Code/Dart-Code/blob/master/src/extension/providers/debug_config_provider.ts#L101 and other return statements in there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug issues that related to debug functionality
Projects
None yet
Development

No branches or pull requests

2 participants