You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Handle debugger restart request (with a cold restart) for Flutter profile/release mode #4281
We can't hide the "restart" button (which we usually use for Hot Restart) because VS Code doesn't allow it (restart should always be possible, even if it's not a Hot Restart, because it should just be the same as stopping the session and starting it again). We also can't currently tell VS Code to handle the restart because we only know about profile/release flags in launchRequest (not during startup when capabilities are exchanged).
So there are a few options:
Do nothing. This means the restart button on the debug toolbar will not work, and instead prints an error to the console in profile/release mode:
Failed to Hot Restart: DebugAdapterException: Exception: Restart is not supported in profile mode
Handle restartRequest in the DAP and terminate the flutter run process, clean up all state, and then restart it (this is probably the best solution, but also complex)
Pass an additional flag for profile/release mode to the flutter debug_adapter process so it's known before launchRequest, and use that to set the supportsRestartRequest capability.
1 is ofc easiest, but I think we should probably do 2.
(on a related note, we should ensure Hot Restart commands are disabled/hidden from the palette etc., since we're just implementing a standard restart here, and having Hot Restart commands show up may be confusing where it's not supporting and we will do a cold restart).
Activity
DanTup commentedon Feb 28, 2023
We can use
CapabilitiesEventto advertise support forsupportsRestartRequestlater.[flutter_tools/dap] Inform DAP client whether restart is supported
DanTup commentedon Feb 28, 2023
flutter/flutter#121610
DanTup commentedon Mar 6, 2023
Fixed by flutter/flutter#121610.