Skip to content

Commit 7832d84

Browse files
authored
Revert "Remove 2023 deprecated 'platforms' key from daemon output (flutter#172593)" (flutter#172883)
This reverts commit cfe6f3d. The change broke the vscode extension. The extension has been updated in Dart-Code/Dart-Code#5610 but it is worth keeping this for a little while longer.
1 parent 9e82be4 commit 7832d84

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/flutter_tools/lib/src/commands/daemon.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,11 @@ class DaemonDomain extends Domain {
599599

600600
PlatformType.values.forEach(handlePlatformType);
601601

602-
return <String, Object>{'platformTypes': platformTypesMap};
602+
return <String, Object>{
603+
// TODO(fujino): delete this key https://github.com/flutter/flutter/issues/140473
604+
'platforms': platformTypes,
605+
'platformTypes': platformTypesMap,
606+
};
603607
} on Exception catch (err, stackTrace) {
604608
sendEvent('log', <String, Object?>{
605609
'log': 'Failed to parse project metadata',
@@ -609,6 +613,7 @@ class DaemonDomain extends Domain {
609613
// On any sort of failure, fall back to Android and iOS for backwards
610614
// compatibility.
611615
return const <String, Object>{
616+
'platforms': <String>['android', 'ios'],
612617
'platformTypes': <String, Object>{
613618
'android': <String, Object>{'isSupported': true},
614619
'ios': <String, Object>{'isSupported': true},

packages/flutter_tools/test/commands.shard/hermetic/daemon_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ void main() {
124124
expect(response.data['id'], 0);
125125
expect(response.data['result'], isNotEmpty);
126126
expect(response.data['result']! as Map<String, Object?>, const <String, Object>{
127+
'platforms': <String>['macos', 'windows'],
127128
'platformTypes': <String, Map<String, Object>>{
128129
'web': <String, Object>{
129130
'isSupported': false,

0 commit comments

Comments
 (0)