Skip to content

Commit 9ff5c25

Browse files
committed
More formatting
1 parent 660eb38 commit 9ff5c25

38 files changed

+498
-539
lines changed

dwds/debug_extension/tool/build_extension.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import 'package:path/path.dart' as p;
2020
const _prodFlag = 'prod';
2121

2222
void main(List<String> arguments) async {
23-
final parser =
24-
ArgParser()..addFlag(_prodFlag, negatable: true, defaultsTo: false);
23+
final parser = ArgParser()
24+
..addFlag(_prodFlag, negatable: true, defaultsTo: false);
2525
final argResults = parser.parse(arguments);
2626

2727
exitCode = await run(isProd: argResults[_prodFlag] as bool);

dwds/debug_extension/tool/update_dev_files.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ void main() async {
1212
Future<void> _updateManifestJson() async {
1313
final manifestJson = File('compiled/manifest.json');
1414
final extensionKeyTxt = File('extension_key.txt');
15-
final extensionKey =
16-
await extensionKeyTxt.exists()
17-
? await extensionKeyTxt.readAsString()
18-
: null;
15+
final extensionKey = await extensionKeyTxt.exists()
16+
? await extensionKeyTxt.readAsString()
17+
: null;
1918
return _transformDevFile(manifestJson, (line) {
2019
if (_matchesKey(line: line, key: 'name')) {
2120
return [

dwds/debug_extension/web/background.dart

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -217,20 +217,19 @@ bool _isInternalNavigation(NavigationInfo navigationInfo) {
217217

218218
DebugInfo _addTabInfo(DebugInfo debugInfo, {required Tab tab}) {
219219
return DebugInfo(
220-
(b) =>
221-
b
222-
..appEntrypointPath = debugInfo.appEntrypointPath
223-
..appId = debugInfo.appId
224-
..appInstanceId = debugInfo.appInstanceId
225-
..appOrigin = debugInfo.appOrigin
226-
..appUrl = debugInfo.appUrl
227-
..authUrl = debugInfo.authUrl
228-
..extensionUrl = debugInfo.extensionUrl
229-
..isInternalBuild = debugInfo.isInternalBuild
230-
..isFlutterApp = debugInfo.isFlutterApp
231-
..workspaceName = debugInfo.workspaceName
232-
..tabUrl = tab.url
233-
..tabId = tab.id,
220+
(b) => b
221+
..appEntrypointPath = debugInfo.appEntrypointPath
222+
..appId = debugInfo.appId
223+
..appInstanceId = debugInfo.appInstanceId
224+
..appOrigin = debugInfo.appOrigin
225+
..appUrl = debugInfo.appUrl
226+
..authUrl = debugInfo.authUrl
227+
..extensionUrl = debugInfo.extensionUrl
228+
..isInternalBuild = debugInfo.isInternalBuild
229+
..isFlutterApp = debugInfo.isFlutterApp
230+
..workspaceName = debugInfo.workspaceName
231+
..tabUrl = tab.url
232+
..tabId = tab.id,
234233
);
235234
}
236235

@@ -280,8 +279,9 @@ void _setWarningIcon(int tabId) {
280279
}
281280

282281
void _setDefaultIcon(int tabId) {
283-
final iconPath =
284-
isDevMode ? 'static_assets/dart_dev.png' : 'static_assets/dart_grey.png';
282+
final iconPath = isDevMode
283+
? 'static_assets/dart_dev.png'
284+
: 'static_assets/dart_grey.png';
285285
setExtensionIcon(IconInfo(path: iconPath));
286286
setExtensionPopup(PopupDetails(popup: '', tabId: tabId));
287287
}

dwds/debug_extension/web/cross_extension_communication.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@ void maybeForwardMessageToAngularDartDevTools({
5858
}) {
5959
if (!_eventsForAngularDartDevTools.contains(method)) return;
6060

61-
final message =
62-
method.startsWith('dwds')
63-
? _dwdsEventMessage(method: method, params: params, tabId: tabId)
64-
: _debugEventMessage(method: method, params: params, tabId: tabId);
61+
final message = method.startsWith('dwds')
62+
? _dwdsEventMessage(method: method, params: params, tabId: tabId)
63+
: _debugEventMessage(method: method, params: params, tabId: tabId);
6564

6665
_forwardMessageToAngularDartDevTools(message);
6766
}

dwds/debug_extension/web/data_types.g.dart

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dwds/debug_extension/web/debug_info.dart

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,15 @@ String _readDartDebugInfo() {
3030
return jsonEncode(
3131
serializers.serialize(
3232
DebugInfo(
33-
(b) =>
34-
b
35-
..appEntrypointPath =
36-
windowContext['\$dartEntrypointPath'] as String?
37-
..appId = windowContext['\$dartAppId'] as String?
38-
..appInstanceId = windowContext['\$dartAppInstanceId'] as String?
39-
..appOrigin = window.location.origin
40-
..appUrl = window.location.href
41-
..extensionUrl = windowContext['\$dartExtensionUri'] as String?
42-
..isInternalBuild = windowContext['\$isInternalBuild'] as bool?
43-
..isFlutterApp = windowContext['\$isFlutterApp'] as bool?,
33+
(b) => b
34+
..appEntrypointPath = windowContext['\$dartEntrypointPath'] as String?
35+
..appId = windowContext['\$dartAppId'] as String?
36+
..appInstanceId = windowContext['\$dartAppInstanceId'] as String?
37+
..appOrigin = window.location.origin
38+
..appUrl = window.location.href
39+
..extensionUrl = windowContext['\$dartExtensionUri'] as String?
40+
..isInternalBuild = windowContext['\$isInternalBuild'] as bool?
41+
..isFlutterApp = windowContext['\$isFlutterApp'] as bool?,
4442
),
4543
),
4644
);

dwds/debug_extension/web/debug_session.dart

Lines changed: 31 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,9 @@ Future<bool> _connectToDwds({
351351
}
352352
final uri = Uri.parse(extensionUrl);
353353
// Start the client connection with DWDS:
354-
final client =
355-
uri.isScheme('ws') || uri.isScheme('wss')
356-
? WebSocketClient(WebSocketChannel.connect(uri))
357-
: SseSocketClient(
358-
SseClient(uri.toString(), debugKey: 'DebugExtension'),
359-
);
354+
final client = uri.isScheme('ws') || uri.isScheme('wss')
355+
? WebSocketClient(WebSocketChannel.connect(uri))
356+
: SseSocketClient(SseClient(uri.toString(), debugKey: 'DebugExtension'));
360357
final trigger = _tabIdToTrigger[dartAppTabId];
361358
debugLog('Connecting to DWDS...', verbose: true);
362359
final debugSession = _DebugSession(
@@ -386,14 +383,13 @@ Future<bool> _connectToDwds({
386383
final tabUrl = await _getTabUrl(dartAppTabId);
387384
debugSession.sendEvent(
388385
DevToolsRequest(
389-
(b) =>
390-
b
391-
..appId = debugInfo.appId
392-
..instanceId = debugInfo.appInstanceId
393-
..contextId = dartAppContextId
394-
..tabUrl = tabUrl
395-
..uriOnly = true
396-
..client = trigger?.clientName ?? 'unknown',
386+
(b) => b
387+
..appId = debugInfo.appId
388+
..instanceId = debugInfo.appInstanceId
389+
..contextId = dartAppContextId
390+
..tabUrl = tabUrl
391+
..uriOnly = true
392+
..client = trigger?.clientName ?? 'unknown',
397393
),
398394
);
399395
return true;
@@ -445,10 +441,9 @@ void _forwardDwdsEventToChromeDebugger(
445441
) {
446442
try {
447443
final messageParams = message.commandParams;
448-
final params =
449-
messageParams == null
450-
? <String, Object>{}
451-
: BuiltMap<String, Object>(json.decode(messageParams)).toMap();
444+
final params = messageParams == null
445+
? <String, Object>{}
446+
: BuiltMap<String, Object>(json.decode(messageParams)).toMap();
452447

453448
chrome.debugger.sendCommand(
454449
Debuggee(tabId: tabId),
@@ -461,11 +456,10 @@ void _forwardDwdsEventToChromeDebugger(
461456
jsonEncode(
462457
serializers.serialize(
463458
ExtensionResponse(
464-
(b) =>
465-
b
466-
..id = message.id
467-
..success = false
468-
..result = JSON.stringify(chrome.runtime.lastError),
459+
(b) => b
460+
..id = message.id
461+
..success = false
462+
..result = JSON.stringify(chrome.runtime.lastError),
469463
),
470464
),
471465
),
@@ -475,11 +469,10 @@ void _forwardDwdsEventToChromeDebugger(
475469
jsonEncode(
476470
serializers.serialize(
477471
ExtensionResponse(
478-
(b) =>
479-
b
480-
..id = message.id
481-
..success = true
482-
..result = JSON.stringify(e),
472+
(b) => b
473+
..id = message.id
474+
..success = true
475+
..result = JSON.stringify(e),
483476
),
484477
),
485478
),
@@ -612,10 +605,9 @@ Future<bool> _sendConnectFailureMessage(
612605
final json = jsonEncode(
613606
serializers.serialize(
614607
ConnectFailure(
615-
(b) =>
616-
b
617-
..tabId = dartAppTabId
618-
..reason = reason.name,
608+
(b) => b
609+
..tabId = dartAppTabId
610+
..reason = reason.name,
619611
),
620612
),
621613
);
@@ -634,11 +626,10 @@ Future<bool> _sendStopDebuggingMessage(
634626
final json = jsonEncode(
635627
serializers.serialize(
636628
DebugStateChange(
637-
(b) =>
638-
b
639-
..tabId = dartAppTabId
640-
..reason = reason.name
641-
..newState = DebugStateChange.stopDebugging,
629+
(b) => b
630+
..tabId = dartAppTabId
631+
..reason = reason.name
632+
..newState = DebugStateChange.stopDebugging,
642633
),
643634
),
644635
);
@@ -747,10 +738,9 @@ DebuggerLocation? _debuggerLocation(int dartAppTabId) {
747738
/// Construct an [ExtensionEvent] from [method] and [params].
748739
ExtensionEvent _extensionEventFor(String method, dynamic params) {
749740
return ExtensionEvent(
750-
(b) =>
751-
b
752-
..params = jsonEncode(json.decode(JSON.stringify(params)))
753-
..method = jsonEncode(method),
741+
(b) => b
742+
..params = jsonEncode(json.decode(JSON.stringify(params)))
743+
..method = jsonEncode(method),
754744
);
755745
}
756746

dwds/debug_extension/web/messaging.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,12 @@ Future<bool> _sendMessage({
154154
required Script recipient,
155155
int? tabId,
156156
}) {
157-
final message =
158-
Message(to: recipient, from: sender, type: type, body: body).toJSON();
157+
final message = Message(
158+
to: recipient,
159+
from: sender,
160+
type: type,
161+
body: body,
162+
).toJSON();
159163
final completer = Completer<bool>();
160164
void responseHandler([dynamic _]) {
161165
final error = chrome.runtime.lastError;

dwds/debug_extension/web/panel.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,9 @@ Future<void> _launchDebugConnection(Event _) async {
276276
final json = jsonEncode(
277277
serializers.serialize(
278278
DebugStateChange(
279-
(b) =>
280-
b
281-
..tabId = _tabId
282-
..newState = DebugStateChange.startDebugging,
279+
(b) => b
280+
..tabId = _tabId
281+
..newState = DebugStateChange.startDebugging,
283282
),
284283
),
285284
);

dwds/debug_extension/web/popup.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,9 @@ Future<bool> _insertAppId() async {
109109
Future<void> _openIssueTracker(Event _) async {
110110
final debugInfo = await _fetchDebugInfo(await _tabId);
111111
final isInternalBuild = debugInfo?.isInternalBuild ?? false;
112-
final issueTrackerLink =
113-
isInternalBuild
114-
? 'http://b/issues/new?component=775375&template=1791321'
115-
: 'https://github.com/dart-lang/webdev/issues/new?labels=dart-debug-extension&projects=&template=dart_debug_extension.md';
112+
final issueTrackerLink = isInternalBuild
113+
? 'http://b/issues/new?component=775375&template=1791321'
114+
: 'https://github.com/dart-lang/webdev/issues/new?labels=dart-debug-extension&projects=&template=dart_debug_extension.md';
116115
await createTab(issueTrackerLink);
117116
}
118117

@@ -121,10 +120,9 @@ Future<void> _launchDevTools(Event _) async {
121120
final json = jsonEncode(
122121
serializers.serialize(
123122
DebugStateChange(
124-
(b) =>
125-
b
126-
..tabId = tabId
127-
..newState = DebugStateChange.startDebugging,
123+
(b) => b
124+
..tabId = tabId
125+
..newState = DebugStateChange.startDebugging,
128126
),
129127
),
130128
);

0 commit comments

Comments
 (0)