Repository navigation
refactor(flutter_tools): unify OptionDescriptor identity and addTo - #196076
Merged
Merged
Conversation
…on factories - Rename `hideOverride` to `hide` and add `String? help` on `OptionDescriptor.addTo`, `OptionBundle.register`, and `ArgParserDescriptorExtension` to match `package:args/typed.dart`. - Unify `DebuggingOptionDescriptors.devToolsServerAddress` onto a single `const StringOptionDescriptor`, passing `devToolsServerAddressBaseHelp` via `addTo(..., help: ...)` when `--devtools` is omitted so `FlutterCommand.devToolsServerAddress` queries the registered descriptor instance. - Replace `DebuggingOptionDescriptors.startPaused(...)` / `startPausedOption` with an instance-scoped `_startPaused` descriptor on `RunCommandBase`, and inline `DriveCommand._publishPort` as `const`. Part of flutter#194338
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors option descriptors and bundles in flutter_tools to preserve descriptor identity, replacing dynamic helper methods with static constants and updating registration signatures to support custom help overrides and a unified hide parameter. Feedback suggests extracting duplicated help text for _publishPort into a shared constant to maintain a single source of truth, and keeping devToolsServerAddress in DdsAndDevToolsOptionsBundle.descriptors to preserve the completeness of the public descriptors contract.
…re publishPortHelp - Remove unused `includeEnableDevTools` and custom `register` override from `DdsAndDevToolsOptionsBundle` so `devToolsServerAddress` stays directly in `descriptors`. - Extract `DebuggingOptionDescriptors.publishPortHelp` and share it with `DriveCommand._publishPort`. - Verify `DdsAndDevToolsOptionsBundle.descriptors` and `addDdsOptions` in `option_descriptor_test.dart`.
bkonyi
approved these changes
Nov 6, 2026
auto-submit Bot
pushed a commit
to flutter/packages
that referenced
this pull request
Nov 7, 2026
flutter/flutter@09175cd...e36b370 2026-11-07 [email protected] Roll Fuchsia Linux SDK from KIc0XZbhLmvDpTluZ... to Sf2yvdTiFXAKkfLkD... (flutter/flutter#196160) 2026-11-07 [email protected] Roll pub packages (flutter/flutter#196155) 2026-11-07 [email protected] [iOS a11y] Use a real `UIScrollView` as a11y scrollable container (flutter/flutter#195731) 2026-11-07 [email protected] Add ParagraphStyle.hyphenCharacter to dart:ui (flutter/flutter#195345) 2026-11-07 [email protected] Roll pub packages (flutter/flutter#196143) 2026-11-06 [email protected] [Linux] Fix layer position when compositing without glBlitFramebuffer (flutter/flutter#196083) 2026-11-06 [email protected] Add support for riscv64 desktop linux engine (flutter/flutter#178712) 2026-11-06 [email protected] Add ResizeImagePolicy.cover (flutter/flutter#194665) 2026-11-06 [email protected] Roll Skia from f533d4034900 to b11315d0a096 (6 revisions) (flutter/flutter#196138) 2026-11-06 [email protected] iOS: Remove dead code/unused imports from FlutterPlatformViewsController (flutter/flutter#196084) 2026-11-06 [email protected] Replace pull_request_target workflows with pull_request + workflow_run (flutter/flutter#195536) 2026-11-06 [email protected] [master] Update Flutter DEPS to Dart 3b174b7217fe09b21da836ea623932b5f041b091 (flutter/flutter#196004) 2026-11-06 [email protected] Fix android_hardware_smoke_test retry mechanisms (flutter/flutter#195708) 2026-11-06 [email protected] Roll Skia from 452b9c1e5db6 to f533d4034900 (1 revision) (flutter/flutter#196129) 2026-11-06 [email protected] [flutter_tools] Use `ErrorHandlingFileSystem.deleteIfExists` for `IOSCoreDeviceControl` temp directory cleanup (flutter/flutter#195913) 2026-11-06 [email protected] Adds guideline tests to flutter create samples (flutter/flutter#195827) 2026-11-06 [email protected] refactor(flutter_tools): unify OptionDescriptor identity and addTo (flutter/flutter#196076) 2026-11-06 [email protected] Roll pub packages (flutter/flutter#196114) 2026-11-06 [email protected] Roll Skia from 5ce64e63a0e7 to 452b9c1e5db6 (5 revisions) (flutter/flutter#196111) 2026-11-06 [email protected] Add PlatformDispatcher.onAlwaysUse24HourFormatChanged callback (flutter/flutter#194670) 2026-11-06 [email protected] Roll Packages from 0478162 to 63881f9 (10 revisions) (flutter/flutter#196108) 2026-11-06 [email protected] Roll Skia from 793b8ac73d4b to 5ce64e63a0e7 (4 revisions) (flutter/flutter#196107) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aligns
OptionDescriptor.addTo({bool? hide, String? help}) with upcomingpackage:args/typed.dart(dart-lang/core#1012) and removes the three non-constOptionDescriptorfactories inDebuggingOptionDescriptorsso every option lookup queries the exact descriptor instance registered onArgParser:DebuggingOptionDescriptors.devToolsServerAddress: ConsolidatesdevToolsServerAddress(...)anddevToolsServerAddressOptioninto a singleconstdescriptor, passingdevToolsServerAddressBaseHelpviaaddTo(..., help: ...)when--devtoolsis omitted soFlutterCommand.devToolsServerAddressmatches the registered instance.RunCommandBase._startPaused&DriveCommand._publishPort: ReplacesstartPaused(...)/startPausedOption(queried at line 211) with an instance-scoped_startPausedfield onRunCommandBase, and inlinespublishPortOption(enabledByDefault: false)asstatic const _publishPortonDriveCommand.Part of #194338
Pre-launch Checklist
///).