-
Notifications
You must be signed in to change notification settings - Fork 318
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
Disable hot reload profile/release mode #4276
Comments
I think the Hot Reload button used to use the presence of the service extension to be enabled, but maybe when adding support for hot-reloading Dart (non-Flutter) the condition was removed. I guess it should be "(is Flutter and service extension is available) || is not Flutter". As for Restart, we can't actually disable that button, it's not a "Hot Restart" button but rather just a "Restart Debugging session" button that in the case of Flutter works by doing a Hot Restart (since it's faster). However, it should work because it should just stop the existing session (closing the app) and then restart it (a new instance of |
Sounds good to me 👍 |
I've pushed a change that hides/disabled Hot Reload for Flutter apps when the reloadSources extension is not available (it remains enabled/visible for Dart projects since they don't require this service and work via a standard VM Service API). However, restart is more complicated. 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:
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). |
The hot reload and hot restart buttons should be disabled when you run in profile or release mode, since they won't work. See flutter/flutter#37987.
The text was updated successfully, but these errors were encountered: