Skip to content

Conversation

@DanTup
Copy link
Member

@DanTup DanTup commented Jul 28, 2025

The format of this changed but we never updated, and the legacy format was recently removed.

See flutter/flutter#140473, flutter/flutter#172593

Fixes #5606

@DanTup DanTup added this to the v3.116.0 milestone Jul 28, 2025
@DanTup DanTup added is bug fix in flutter Relates to running Flutter apps labels Jul 28, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @DanTup, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a breaking change in the Flutter daemon's getSupportedPlatforms API, which recently removed its legacy response format. I've updated the Dart-Code extension to correctly parse the new response structure, ensuring that the extension can continue to accurately detect and display supported platforms for Flutter projects. This is a critical compatibility fix to maintain core functionality.

Highlights

  • API Compatibility Update: I've updated the SupportedPlatformsResponse interface in src/shared/flutter/daemon_interfaces.ts (lines 79-80) to accommodate the new platformTypes field returned by the Flutter daemon's getSupportedPlatforms method. The old platforms array is now marked as legacy and optional.
  • Platform Detection Logic Refinement: The tryGetSupportedPlatforms method in src/shared/vscode/device_manager.ts has been renamed to tryGetSupportedPlatformTypes (line 375) and its implementation (lines 381-382) now intelligently parses the daemon's response, extracting platform names from either the legacy platforms array or the new platformTypes map, ensuring backward and forward compatibility.
  • Integration Across Components: Calls to the updated platform detection logic have been adjusted in src/extension/providers/debug_config_provider.ts (lines 174, 185) and within src/shared/vscode/device_manager.ts itself (lines 367, 467, 471) to reflect the new method name and its simplified string[] return type.
  • Unit Test Alignment: The unit tests in src/test/flutter/device_manager.test.ts (lines 260-277) and the FakeFlutterDaemon mock (lines 338-341) have been updated to align with the new getSupportedPlatforms response structure and the renamed tryGetSupportedPlatformTypes method, ensuring test coverage for the updated functionality.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the handling of the getSupportedPlatforms response from the Flutter daemon to support the new format, which is a great improvement for compatibility. The changes are well-contained and correctly update the interface, implementation, and tests.

I've identified one high-severity correctness issue where the isSupported flag from the new API response is not being checked, which could lead to incorrect platform support detection. I've also found a minor typo in a test description.

My feedback includes suggestions to address these points to improve the correctness and quality of the code. Overall, this is a solid PR that addresses an important API change.

@DanTup DanTup requested a review from Copilot July 28, 2025 09:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the code to handle changes in Flutter daemon's getSupportedPlatforms response format. The Flutter daemon changed from returning a platforms array to a platformTypes object, and the legacy format was recently removed.

Key changes:

  • Updated method names from tryGetSupportedPlatforms to tryGetSupportedPlatformTypes
  • Modified response handling to support both legacy platforms array and new platformTypes object format
  • Updated interface definitions to reflect the new response structure

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/shared/flutter/daemon_interfaces.ts Updated SupportedPlatformsResponse interface to include both legacy and new format fields
src/shared/vscode/device_manager.ts Renamed method and updated logic to handle both response formats with fallback
src/extension/providers/debug_config_provider.ts Updated method calls to use the new method name
src/test/flutter/device_manager.test.ts Updated test method names and mock implementation to use new format

DanTup added 2 commits July 28, 2025 10:41
The format of this changed but we never updated, and the legacy format was recently removed.

See flutter/flutter#140473, flutter/flutter#172593

Fixes #5606
@DanTup DanTup force-pushed the fix-enabled-platforms branch from 91b5a3d to 898c84c Compare July 28, 2025 09:41
@DanTup DanTup merged commit 0b4c936 into master Jul 28, 2025
17 of 19 checks passed
@DanTup DanTup deleted the fix-enabled-platforms branch July 28, 2025 10:09
chingjun added a commit to chingjun/flutter that referenced this pull request Jul 28, 2025
…lutter#172593)"

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.
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Jul 29, 2025
…172593)" (#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.
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
…lutter#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.
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
…lutter#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.
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
…lutter#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.
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
…lutter#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in flutter Relates to running Flutter apps is bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Devices aren't appearing when I click the menu in the bottom-right corner.

2 participants