Skip to content

Commit cea99d7

Browse files
committed
Add filter condition inline
1 parent a4088af commit cea99d7

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

packages/devtools_app/lib/src/standalone_ui/ide_shared/property_editor/property_editor_controller.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ class PropertyEditorController extends DisposableController
156156
(result?.args ?? <EditableArgument>[])
157157
.map(argToProperty)
158158
.nonNulls
159-
.where(notDeprecatedWithNoValue)
159+
// Filter out any deprecated properties that aren't set.
160+
.where((property) => !property.isDeprecated || property.hasArgument)
160161
.toList();
161162
final name = result?.name;
162163
_editableWidgetData.value = (

packages/devtools_app/lib/src/standalone_ui/ide_shared/property_editor/property_editor_types.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,6 @@ EditableProperty? argToProperty(EditableArgument argument) {
220220
}
221221
}
222222

223-
bool notDeprecatedWithNoValue(EditableArgument argument) =>
224-
!(argument.isDeprecated && !argument.hasArgument);
225-
226223
/// The following types should match those returned by the Analysis Server. See:
227224
/// https://github.com/dart-lang/sdk/blob/154b473cdb65c2686bb44fedec03ba2deddb80fd/pkg/analysis_server/lib/src/lsp/handlers/custom/editable_arguments/handler_editable_arguments.dart#L182
228225
const stringType = 'string';

0 commit comments

Comments
 (0)