From d075d647c301da98b5ab5fe19d8163ce29e25d41 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Thu, 18 Apr 2019 11:00:54 -0700 Subject: [PATCH] remove the unused hintMessage and hintId fields from the reload results (#31267) --- packages/flutter_tools/doc/daemon.md | 2 +- packages/flutter_tools/lib/src/commands/daemon.dart | 9 +-------- packages/flutter_tools/lib/src/resident_runner.dart | 13 +------------ packages/flutter_tools/lib/src/run_hot.dart | 2 -- .../flutter_tools/test/commands/daemon_test.dart | 4 ---- 5 files changed, 3 insertions(+), 27 deletions(-) diff --git a/packages/flutter_tools/doc/daemon.md b/packages/flutter_tools/doc/daemon.md index 52cd06daf0..1a849b34f7 100644 --- a/packages/flutter_tools/doc/daemon.md +++ b/packages/flutter_tools/doc/daemon.md @@ -78,7 +78,7 @@ It is up to the client to decide how best to display the message; for some clien #### app.restart -The `restart()` restarts the given application. It returns a Map of `{ int code, String message, String hintMessage, String hintId }` to indicate success or failure in restarting the app. A `code` of `0` indicates success, and non-zero indicates a failure. If `hintId` is non-null and equal to `restartRecommended`, that indicates that the reload was successful, but not all reloaded elements were executed during view reassembly (i.e., the user might not see all the changes in the current UI, and a restart could be necessary). +The `restart()` restarts the given application. It returns a Map of `{ int code, String message }` to indicate success or failure in restarting the app. A `code` of `0` indicates success, and non-zero indicates a failure. - `appId`: the id of a previously started app; this is required. - `fullRestart`: optional; whether to do a full (rather than an incremental) restart of the application diff --git a/packages/flutter_tools/lib/src/commands/daemon.dart b/packages/flutter_tools/lib/src/commands/daemon.dart index 08e52075a1..c7e7b9e2b6 100644 --- a/packages/flutter_tools/lib/src/commands/daemon.dart +++ b/packages/flutter_tools/lib/src/commands/daemon.dart @@ -722,17 +722,10 @@ Map _emulatorToMap(Emulator emulator) { } Map _operationResultToMap(OperationResult result) { - final Map map = { + return { 'code': result.code, 'message': result.message, }; - - if (result.hintMessage != null) - map['hintMessage'] = result.hintMessage; - if (result.hintId != null) - map['hintId'] = result.hintId; - - return map; } dynamic _toJsonable(dynamic obj) { diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart index 47b7964efe..3325255f8f 100644 --- a/packages/flutter_tools/lib/src/resident_runner.dart +++ b/packages/flutter_tools/lib/src/resident_runner.dart @@ -1017,7 +1017,7 @@ abstract class ResidentRunner { } class OperationResult { - OperationResult(this.code, this.message, { this.hintMessage, this.hintId }); + OperationResult(this.code, this.message); /// The result of the operation; a non-zero code indicates a failure. final int code; @@ -1025,17 +1025,6 @@ class OperationResult { /// A user facing message about the results of the operation. final String message; - /// An optional hint about the results of the operation. This is used to provide - /// sidecar data about the operation results. For example, this is used when - /// a reload is successful but some changed program elements where not run after a - /// reassemble. - final String hintMessage; - - /// A key used by tools to discriminate between different kinds of operation results. - /// For example, a successful reload might have a [code] of 0 and a [hintId] of - /// `'restartRecommended'`. - final String hintId; - bool get isOk => code == 0; static final OperationResult ok = OperationResult(0, ''); diff --git a/packages/flutter_tools/lib/src/run_hot.dart b/packages/flutter_tools/lib/src/run_hot.dart index ee8706cbc1..8a061a6d6e 100644 --- a/packages/flutter_tools/lib/src/run_hot.dart +++ b/packages/flutter_tools/lib/src/run_hot.dart @@ -586,8 +586,6 @@ class HotRunner extends ResidentRunner { printStatus('${result.message}.'); } } - if (result.hintMessage != null) - printStatus('\n${result.hintMessage}'); return result; } } diff --git a/packages/flutter_tools/test/commands/daemon_test.dart b/packages/flutter_tools/test/commands/daemon_test.dart index c419bfaea6..64d348fc53 100644 --- a/packages/flutter_tools/test/commands/daemon_test.dart +++ b/packages/flutter_tools/test/commands/daemon_test.dart @@ -293,10 +293,6 @@ void main() { jsonEncodeObject(OperationResult(1, 'foo')), '{"code":1,"message":"foo"}', ); - expect( - jsonEncodeObject(OperationResult(0, 'foo', hintMessage: 'my hint', hintId: 'myId')), - '{"code":0,"message":"foo","hintMessage":"my hint","hintId":"myId"}', - ); }); }); }