Skip to content

Commit 4085b15

Browse files
committed
Formatting
1 parent 0fd4a05 commit 4085b15

17 files changed

+236
-260
lines changed

dwds/lib/src/debugging/chrome_inspector.dart

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,10 @@ class ChromeAppInspector extends AppInspector {
235235
String selector, [
236236
List<dynamic> arguments = const [],
237237
]) async {
238-
final remoteArguments =
239-
arguments.cast<String>().map(remoteObjectFor).toList();
238+
final remoteArguments = arguments
239+
.cast<String>()
240+
.map(remoteObjectFor)
241+
.toList();
240242
// We special case the Dart library, where invokeMethod won't work because
241243
// it's not really a Dart object.
242244
if (isLibraryId(targetId)) {
@@ -263,15 +265,15 @@ class ChromeAppInspector extends AppInspector {
263265
}
264266
return globalToolConfiguration.loadStrategy is DdcLibraryBundleStrategy
265267
? _evaluateLibraryMethodWithDdcLibraryBundle(
266-
libraryUri,
267-
selector,
268-
arguments,
269-
)
268+
libraryUri,
269+
selector,
270+
arguments,
271+
)
270272
: _evaluateInLibrary(
271-
libraryUri,
272-
'function () { return this.$selector.apply(this, arguments); }',
273-
arguments,
274-
);
273+
libraryUri,
274+
'function () { return this.$selector.apply(this, arguments); }',
275+
arguments,
276+
);
275277
}
276278

277279
/// Evaluate [expression] by calling Chrome's Runtime.evaluate.
@@ -575,14 +577,15 @@ class ChromeAppInspector extends AppInspector {
575577
offset: offset,
576578
length: length,
577579
);
578-
final args =
579-
[offset, rangeCount].map(dartIdFor).map(remoteObjectFor).toList();
580+
final args = [
581+
offset,
582+
rangeCount,
583+
].map(dartIdFor).map(remoteObjectFor).toList();
580584
// If this is a List, just call sublist. If it's a Map, get the entries, but
581585
// avoid doing a toList on a large map using skip/take to get the section we
582586
// want. To make those alternatives easier in JS, pass both count and end.
583-
final expression =
584-
globalToolConfiguration.loadStrategy.dartRuntimeDebugger
585-
.getSubRangeJsExpression();
587+
final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
588+
.getSubRangeJsExpression();
586589

587590
return await jsCallFunctionOn(receiver, expression, args);
588591
}
@@ -625,9 +628,8 @@ class ChromeAppInspector extends AppInspector {
625628
/// Updates [Isolate.extensionRPCs] to this set.
626629
@override
627630
Future<Set<String>> getExtensionRpcs() async {
628-
final expression =
629-
globalToolConfiguration.loadStrategy.dartRuntimeDebugger
630-
.getDartDeveloperExtensionNamesJsExpression();
631+
final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
632+
.getDartDeveloperExtensionNamesJsExpression();
631633
final extensionRpcs = <String>{};
632634
final params = {
633635
'expression': expression,

dwds/lib/src/debugging/classes.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,9 @@ class ChromeAppClassHelper {
142142

143143
final superClassLibraryId = classDescriptor['superClassLibraryId'];
144144
final superClassName = classDescriptor['superClassName'];
145-
final superClassRef =
146-
superClassName == null
147-
? null
148-
: classRefFor(superClassLibraryId, superClassName);
145+
final superClassRef = superClassName == null
146+
? null
147+
: classRefFor(superClassLibraryId, superClassName);
149148

150149
// TODO: Implement the rest of these
151150
// https://github.com/dart-lang/webdev/issues/176.

dwds/lib/src/debugging/debugger.dart

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,9 @@ class Debugger {
8686
// DevTools is showing an overlay. Both cannot be shown at the same time:
8787
// bool _pausedOverlayVisible = false;
8888

89-
String get pauseState =>
90-
_pauseModePauseStates.entries
91-
.firstWhere((entry) => entry.value == _pauseState)
92-
.key;
89+
String get pauseState => _pauseModePauseStates.entries
90+
.firstWhere((entry) => entry.value == _pauseState)
91+
.key;
9392

9493
/// The JS frames at the current paused location.
9594
///
@@ -540,17 +539,15 @@ class Debugger {
540539
final timestamp = DateTime.now().millisecondsSinceEpoch;
541540
final jsBreakpointIds = e.hitBreakpoints ?? [];
542541
if (jsBreakpointIds.isNotEmpty) {
543-
final breakpointIds =
544-
jsBreakpointIds
545-
.map((id) => _breakpoints._dartIdByJsId[id])
546-
// In case the breakpoint was set in Chrome DevTools outside of
547-
// package:dwds.
548-
.where((entry) => entry != null)
549-
.toSet();
550-
final pauseBreakpoints =
551-
isolate.breakpoints
552-
?.where((bp) => breakpointIds.contains(bp.id))
553-
.toList();
542+
final breakpointIds = jsBreakpointIds
543+
.map((id) => _breakpoints._dartIdByJsId[id])
544+
// In case the breakpoint was set in Chrome DevTools outside of
545+
// package:dwds.
546+
.where((entry) => entry != null)
547+
.toSet();
548+
final pauseBreakpoints = isolate.breakpoints
549+
?.where((bp) => breakpointIds.contains(bp.id))
550+
.toList();
554551
event = Event(
555552
kind: EventKind.kPauseBreakpoint,
556553
timestamp: timestamp,

dwds/lib/src/debugging/inspector.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,9 @@ abstract class AppInspector {
145145
ModifiedModuleReport? modifiedModuleReport,
146146
}) {
147147
return _scriptCacheMemoizer.runOnce(() async {
148-
final scripts =
149-
await globalToolConfiguration.loadStrategy
150-
.metadataProviderFor(appConnection.request.entrypointPath)
151-
.scripts;
148+
final scripts = await globalToolConfiguration.loadStrategy
149+
.metadataProviderFor(appConnection.request.entrypointPath)
150+
.scripts;
152151
if (modifiedModuleReport != null) {
153152
// Invalidate any script caches that were computed for the now invalid
154153
// libraries. They will get repopulated below.

dwds/lib/src/debugging/instance.dart

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,9 @@ class ChromeAppInstanceHelper {
267267
objectId,
268268
offset: offset,
269269
count: count,
270-
length:
271-
metaData.kind != InstanceKind.kPlainInstance ? metaData.length : null,
270+
length: metaData.kind != InstanceKind.kPlainInstance
271+
? metaData.length
272+
: null,
272273
);
273274

274275
final dartProperties = await _dartFieldsFor(properties, remoteObject);
@@ -307,9 +308,8 @@ class ChromeAppInstanceHelper {
307308
// We do this in in awkward way because we want the keys and values, but we
308309
// can't return things by value or some Dart objects will come back as
309310
// values that we need to be RemoteObject, e.g. a List of int.
310-
final expression =
311-
globalToolConfiguration.loadStrategy.dartRuntimeDebugger
312-
.getMapElementsJsExpression();
311+
final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
312+
.getMapElementsJsExpression();
313313

314314
final keysAndValues = await inspector.jsCallFunctionOn(map, expression, []);
315315
final keys = await inspector.loadField(keysAndValues, 'keys');
@@ -507,10 +507,12 @@ class ChromeAppInstanceHelper {
507507

508508
// Collect named fields in the requested range.
509509
// Account for already collected positional fields.
510-
final namedRangeOffset =
511-
offset == null ? null : _remainingCount(positionalCount, offset);
512-
final namedRangeCount =
513-
count == null ? null : _remainingCount(positionalRangeCount, count);
510+
final namedRangeOffset = offset == null
511+
? null
512+
: _remainingCount(positionalCount, offset);
513+
final namedRangeCount = count == null
514+
? null
515+
: _remainingCount(positionalRangeCount, count);
514516
final namedInstance = await instanceFor(
515517
namedObject,
516518
offset: namedRangeOffset,
@@ -537,9 +539,8 @@ class ChromeAppInstanceHelper {
537539
// We do this in in awkward way because we want the keys and values, but we
538540
// can't return things by value or some Dart objects will come back as
539541
// values that we need to be RemoteObject, e.g. a List of int.
540-
final expression =
541-
globalToolConfiguration.loadStrategy.dartRuntimeDebugger
542-
.getRecordFieldsJsExpression();
542+
final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
543+
.getRecordFieldsJsExpression();
543544

544545
final result = await inspector.jsCallFunctionOn(record, expression, []);
545546
final fieldNameElements = await _recordShapeFields(
@@ -676,9 +677,8 @@ class ChromeAppInstanceHelper {
676677
// We do this in in awkward way because we want the names and types, but we
677678
// can't return things by value or some Dart objects will come back as
678679
// values that we need to be RemoteObject, e.g. a List of int.
679-
final expression =
680-
globalToolConfiguration.loadStrategy.dartRuntimeDebugger
681-
.getRecordTypeFieldsJsExpression();
680+
final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
681+
.getRecordTypeFieldsJsExpression();
682682

683683
final result = await inspector.jsCallFunctionOn(record, expression, []);
684684
final fieldNameElements = await _recordShapeFields(
@@ -707,9 +707,8 @@ class ChromeAppInstanceHelper {
707707
final length = metaData.length;
708708
final objectId = remoteObject.objectId;
709709
if (objectId == null) return null;
710-
final expression =
711-
globalToolConfiguration.loadStrategy.dartRuntimeDebugger
712-
.getSetElementsJsExpression();
710+
final expression = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
711+
.getSetElementsJsExpression();
713712

714713
final result = await inspector.jsCallFunctionOn(
715714
remoteObject,
@@ -812,9 +811,10 @@ class ChromeAppInstanceHelper {
812811
//
813812
// For maps and lists it's more complicated. Treat the actual SDK versions
814813
// of these as special.
815-
final fieldNameExpression =
816-
globalToolConfiguration.loadStrategy.dartRuntimeDebugger
817-
.getObjectFieldNamesJsExpression();
814+
final fieldNameExpression = globalToolConfiguration
815+
.loadStrategy
816+
.dartRuntimeDebugger
817+
.getObjectFieldNamesJsExpression();
818818
final result = await inspector.jsCallFunctionOn(
819819
remoteObject,
820820
fieldNameExpression,
@@ -832,10 +832,9 @@ class ChromeAppInstanceHelper {
832832
/// be something returned by value from Chrome, e.g. number, boolean, or
833833
/// String.
834834
Future<InstanceRef?> instanceRefFor(Object value) {
835-
final remote =
836-
value is RemoteObject
837-
? value
838-
: RemoteObject({'value': value, 'type': _chromeType(value)});
835+
final remote = value is RemoteObject
836+
? value
837+
: RemoteObject({'value': value, 'type': _chromeType(value)});
839838
return _instanceRefForRemote(remote);
840839
}
841840

dwds/lib/src/debugging/libraries.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,9 @@ class LibraryHelper<T extends AppInspector> {
8585
/// using [initialize].
8686
Future<List<LibraryRef>> get libraryRefs async {
8787
if (_libraryRefsById.isNotEmpty) return _libraryRefsById.values.toList();
88-
final libraries =
89-
await globalToolConfiguration.loadStrategy
90-
.metadataProviderFor(inspector.appConnection.request.entrypointPath)
91-
.libraries;
88+
final libraries = await globalToolConfiguration.loadStrategy
89+
.metadataProviderFor(inspector.appConnection.request.entrypointPath)
90+
.libraries;
9291
for (final library in libraries) {
9392
_libraryRefsById[library] = _createLibraryRef(library);
9493
}

dwds/lib/src/debugging/metadata/class.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,10 @@ class ChromeClassMetaDataHelper {
149149
/// Returns null if the [remoteObject] is not a Dart class.
150150
Future<ClassMetaData?> metaDataFor(RemoteObject remoteObject) async {
151151
try {
152-
final evalExpression =
153-
globalToolConfiguration.loadStrategy.dartRuntimeDebugger
154-
.getObjectMetadataJsExpression();
152+
final evalExpression = globalToolConfiguration
153+
.loadStrategy
154+
.dartRuntimeDebugger
155+
.getObjectMetadataJsExpression();
155156

156157
final result = await _inspector.jsCallFunctionOn(
157158
remoteObject,

0 commit comments

Comments
 (0)