Support fuzzy-matching of devices/emulators in launch config/autolaunch#5867
Support fuzzy-matching of devices/emulators in launch config/autolaunch#5867
Conversation
|
@codex review /gemini review |
|
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. |
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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 Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
…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).
Fixes #5854