Unverified Commit 75dc45ab authored by Kenzie Schmoll's avatar Kenzie Schmoll Committed by GitHub

Fix bugs with ext.flutter.activeDevToolsServerAddress (#74423)

parent 444c954f
...@@ -1420,9 +1420,15 @@ abstract class ResidentRunner { ...@@ -1420,9 +1420,15 @@ abstract class ResidentRunner {
} on Exception { } on Exception {
// do nothing // do nothing
} }
vmService.onExtensionEvent.listen((vm_service.Event event) { StreamSubscription<vm_service.Event> extensionStream;
extensionStream = vmService.onExtensionEvent.listen((vm_service.Event event) {
if (event.json['extensionKind'] == 'Flutter.FrameworkInitialization') { if (event.json['extensionKind'] == 'Flutter.FrameworkInitialization') {
// The 'Flutter.FrameworkInitialization' event is sent on hot restart
// as well, so make sure we don't try to complete this twice.
if (!completer.isCompleted) {
completer.complete(); completer.complete();
extensionStream.cancel();
}
} }
}); });
final vm_service.IsolateRef isolateRef = (await vmService.getVM()).isolates.first; final vm_service.IsolateRef isolateRef = (await vmService.getVM()).isolates.first;
......
...@@ -634,6 +634,7 @@ class HotRunner extends ResidentRunner { ...@@ -634,6 +634,7 @@ class HotRunner extends ResidentRunner {
if (!silent) { if (!silent) {
globals.printStatus('Restarted application in ${getElapsedAsMilliseconds(timer.elapsed)}.'); globals.printStatus('Restarted application in ${getElapsedAsMilliseconds(timer.elapsed)}.');
} }
unawaited(maybeCallDevToolsUriServiceExtension());
return result; return result;
} }
final OperationResult result = await _hotReloadHelper( final OperationResult result = await _hotReloadHelper(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment