Unverified Commit ab9ba3f9 authored by Jacob Richman's avatar Jacob Richman Committed by GitHub

Support exposing the InspectorService over the Flutterservice extension...

Support exposing the InspectorService over the Flutterservice extension protocol as well as the observatory protocol. (#15876)

* Support exposing the InspectorService over the Flutter
service extension protocol as well as the observatory protocol.

We will probably remove most of the observatory protocol support once a
couple versions of the Flutter IntelliJ plugin have shipped that use the
Flutter service extension protocol. The only reason to continue supporting
the observatory protocol is it will allow using the inspector when paused
at a breakpoint.
parent 7dd166fa
......@@ -16,6 +16,7 @@ import 'package:flutter/services.dart';
import 'app.dart';
import 'focus_manager.dart';
import 'framework.dart';
import 'widget_inspector.dart';
export 'dart:ui' show AppLifecycleState, Locale;
......@@ -285,6 +286,8 @@ abstract class WidgetsBinding extends BindingBase with SchedulerBinding, Gesture
}
);
// This service extension is deprecated and will be removed by 7/1/2018.
// Use ext.flutter.inspector.show instead.
registerBoolServiceExtension(
name: 'debugWidgetInspector',
getter: () async => WidgetsApp.debugShowWidgetInspectorOverride,
......@@ -295,6 +298,8 @@ abstract class WidgetsBinding extends BindingBase with SchedulerBinding, Gesture
return _forceRebuild();
}
);
WidgetInspectorService.instance.initServiceExtensions(registerServiceExtension);
}
Future<Null> _forceRebuild() {
......
......@@ -506,9 +506,12 @@ void main() {
});
test('Service extensions - posttest', () async {
// See widget_inspector_test.dart for tests of the 15 ext.flutter.inspector
// service extensions included in this count.
// If you add a service extension... TEST IT! :-)
// ...then increment this number.
expect(binding.extensions.length, 17);
expect(binding.extensions.length, 32);
expect(console, isEmpty);
debugPrint = debugPrintThrottled;
......
......@@ -1183,7 +1183,7 @@ class Isolate extends ServiceObjectOwner {
Future<Map<String, dynamic>> flutterTogglePerformanceOverlayOverride() => _flutterToggle('showPerformanceOverlay');
Future<Map<String, dynamic>> flutterToggleWidgetInspector() => _flutterToggle('debugWidgetInspector');
Future<Map<String, dynamic>> flutterToggleWidgetInspector() => _flutterToggle('inspector.show');
Future<Null> flutterDebugAllowBanner(bool show) async {
await invokeFlutterExtensionRpcRaw(
......
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