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

Show the debugger in DevTools when launching from VS Code #1792

Closed
cfanatic opened this issue Apr 5, 2020 · 8 comments
Closed

Show the debugger in DevTools when launching from VS Code #1792

cfanatic opened this issue Apr 5, 2020 · 8 comments
Milestone

Comments

@cfanatic
Copy link

cfanatic commented Apr 5, 2020

Steps to Reproduce

I am running the following setup which is generally working fine:

[✓] Flutter (Channel stable, v1.12.13+hotfix.10-pre.1, on Mac OS X 10.15.4 19E266, locale en-DE)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
[✓] VS Code (version 1.43.2)

Whenever I want to debug my app on the iOS simulator or device, I select Dart: Open DevTools in vscode.

But for some reason, the Debugger tab is deactivated in Chrome as you can tell from the screenshot:

Screenshot 2020-04-05 at 12 21 06

Is there any way to enable debugging inside Chrome DevTools by default? Stripping away hide=debugger from the URL serves the purpose, but I prefer to avoid this doing manually.

Thanks!

@VladyslavBondarenko VladyslavBondarenko transferred this issue from flutter/flutter Apr 6, 2020
@kenzieschmoll
Copy link
Member

Going through some old issues - @DanTup do we still add the hide=debugger query param when opening devtools from VS Code, and if so, do we still want to be doing this?

@kenzieschmoll kenzieschmoll changed the title Debugging in DevTools Show the debugger in DevTools when launching from VS Code Feb 15, 2022
@kenzieschmoll kenzieschmoll added this to the Backlog milestone Feb 15, 2022
@DanTup
Copy link
Contributor

DanTup commented Feb 15, 2022

Yep, we still pass this if you open the non-embedded version.

Removing it makes it easy to have two debuggers connected which will cause issues with restarts (it's not clear who is re-sending breakpoints, or resuming after the restart).

There was talk of using DDS to improve this, but I don't know if that's done (or if so, whether DevTools and VS Code need updating to handle it) - I guess a question for @bkonyi?

@bkonyi
Copy link
Contributor

bkonyi commented Feb 15, 2022

Are you talking about the client synchronization support that was added awhile back?

@DanTup
Copy link
Contributor

DanTup commented Feb 15, 2022

That certainly looks like some of it, yes! :D

Is there help for breakpoints too? To prevent VS code wiping DevTools breakpoints or vice-versa? And is DevTools updated to already use the API(s) above?

@bkonyi
Copy link
Contributor

bkonyi commented Feb 15, 2022

Nope, this basically just prevents another client from resuming underneath you while trying to reset breakpoints. The best way to handle this right now is probably to track which breakpoints your client has set and only reset them after a reload, leaving the other clients responsible for their own breakpoints.

@DanTup
Copy link
Contributor

DanTup commented Feb 15, 2022

Ah, got it. I'll look at adding this to the new SDK DAP (I don't think it makes sense to add to the old one we'll soon migrate away from). I think we'll need to ship it both there and in DevTools before we can safely enable the debugger tab (which might take a little while for VS Code, I suspect the switch over to SDK DAPs will probably start quite slowly - and there still a few small things to complete before that can start).

@jacob314
Copy link
Contributor

+1 to leveraging the https://github.com/dart-lang/sdk/blob/master/pkg/dds/dds_protocol.md#requirepermissiontoresume API. Only leveraging it in the DAP is fine. We'll need to also use the API in DevTools and verify that DevTools only reapplies its breakpoints and not al breakpoints.

@DanTup
Copy link
Contributor

DanTup commented Aug 27, 2024

The VS Code debug adapters now use requirePermissionToResume and the upcoming version of the Dart-Code extension no longer explicitly hides the debugger when launching DevTools.

@DanTup DanTup closed this as completed Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants