Skip to content

Support fuzzy-matching of devices/emulators in launch config/autolaunch#5867

Merged
DanTup merged 5 commits intomasterfrom
fuzzy-match-devices
Jan 6, 2026
Merged

Support fuzzy-matching of devices/emulators in launch config/autolaunch#5867
DanTup merged 5 commits intomasterfrom
fuzzy-match-devices

Conversation

@DanTup
Copy link
Member

@DanTup DanTup commented Jan 6, 2026

Fixes #5854

@DanTup DanTup added this to the v3.128.0 milestone Jan 6, 2026
@DanTup DanTup added is bug fix in flutter Relates to running Flutter apps in debugging Relates to the debug adapter or process of running debug sessions labels Jan 6, 2026
@DanTup DanTup requested a review from Copilot January 6, 2026 12:25
@DanTup
Copy link
Member Author

DanTup commented Jan 6, 2026

@codex review

/gemini review

@gemini-code-assist
Copy link

Thank you for requesting a review! I am now performing a code review for this pull request. My findings will appear as a separate review.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1693e26fd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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 adds fuzzy-matching support for devices and emulators in launch configurations and autolaunch functionality, addressing issue #5854. The implementation allows users to specify partial device/emulator identifiers that will be matched using a prioritized search strategy.

Key changes include:

  • New fuzzy matching methods (findBestDevice, findBestEmulatorDevice, findBestEmulator) with case-insensitive exact, starts-with, and contains matching strategies
  • Updated launch configuration and autolaunch to use fuzzy matching instead of exact ID matching
  • Comprehensive test coverage for all fuzzy matching scenarios

Reviewed changes

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

Show a summary per file
File Description
src/shared/vscode/device_manager.ts Added three new fuzzy-matching methods with prioritized search logic (exact > starts-with > contains, ID > name); renamed waitForDevice to waitForBestDevice; removed internal getEmulator helper method
src/extension/providers/debug_config_provider.ts Updated device/emulator resolution logic to use fuzzy matching methods; improved type safety with explicit variable extraction
src/shared/vscode/autolaunch.ts Updated autolaunch to use fuzzy device matching instead of exact matching
src/test/flutter/device_manager.test.ts Added comprehensive test coverage for fuzzy matching behavior including priority tests and case-insensitivity; made test fixture emulator list mutable
src/test/flutter_test_debug/debug/flutter_test.test.ts Added delay to reduce test flakiness (minor test stabilization unrelated to main PR purpose)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

❌ Patch coverage is 78.37838% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.32%. Comparing base (5007672) to head (36b69ba).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/extension/providers/debug_config_provider.ts 57.14% 5 Missing and 1 partial ⚠️
src/shared/vscode/autolaunch.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5867      +/-   ##
==========================================
+ Coverage   67.20%   67.32%   +0.11%     
==========================================
  Files         168      168              
  Lines       12798    12817      +19     
  Branches     2535     2535              
==========================================
+ Hits         8601     8629      +28     
+ Misses       3751     3741      -10     
- Partials      446      447       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

DanTup added 2 commits January 6, 2026 12:34
…ting the correct label etc.

deviceId might be a partial, so we want to ensure the same device is used everywhere (even if Flutter's search/fuzzy match logic doesn't match ours).
@DanTup DanTup merged commit 902ea2a into master Jan 6, 2026
20 checks passed
@DanTup DanTup deleted the fuzzy-match-devices branch January 6, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in debugging Relates to the debug adapter or process of running debug sessions in flutter Relates to running Flutter apps is bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No longer able to specify devices by partial name in deviceId field in launch.json

2 participants