-
Notifications
You must be signed in to change notification settings - Fork 340
Description
See #4276 (comment).
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 runprocess, 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_adapterprocess so it's known beforelaunchRequest, and use that to set thesupportsRestartRequestcapability.
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).