@@ -375,8 +375,10 @@ class DevHandler {
375
375
376
376
appServices.connectedInstanceId = appConnection.request.instanceId;
377
377
dwdsStats.devToolsStart = DateTime .now ();
378
- await _launchDevTools (appServices.chromeProxyService.remoteDebugger,
379
- _constructDevToolsUri (appServices.debugService.uri));
378
+ await _launchDevTools (
379
+ appServices.chromeProxyService.remoteDebugger,
380
+ _constructDevToolsUri (appServices.debugService.uri,
381
+ ideQueryParam: 'Dwds' ));
380
382
}
381
383
382
384
Future <AppConnection > _handleConnectRequest (
@@ -523,16 +525,24 @@ class DevHandler {
523
525
extensionDebugConnections.add (DebugConnection (appServices));
524
526
_servicesByAppId[appId] = appServices;
525
527
}
526
- final devToolsUri = _constructDevToolsUri (
527
- await _servicesByAppId[appId].debugService.encodedUri);
528
+ final encodedUri = await _servicesByAppId[appId].debugService.encodedUri;
528
529
dwdsStats.devToolsStart = DateTime .now ();
529
530
530
- // If we only want the URI, then return early.
531
+ // If we only want the URI, this means we are embedding Dart DevTools in
532
+ // Chrome DevTools. Therefore return early.
531
533
if (devToolsRequest.uriOnly != null && devToolsRequest.uriOnly) {
534
+ final devToolsUri = _constructDevToolsUri (
535
+ encodedUri,
536
+ ideQueryParam: 'ChromeDevTools' ,
537
+ );
532
538
extensionDebugger.sendEvent ('dwds.devtoolsUri' , devToolsUri);
533
539
return ;
534
540
}
535
541
542
+ final devToolsUri = _constructDevToolsUri (
543
+ encodedUri,
544
+ ideQueryParam: 'DebugExtension' ,
545
+ );
536
546
await _launchDevTools (extensionDebugger, devToolsUri);
537
547
});
538
548
}
@@ -549,12 +559,18 @@ class DevHandler {
549
559
});
550
560
}
551
561
552
- String _constructDevToolsUri (String debugServiceUri) {
562
+ String _constructDevToolsUri (
563
+ String debugServiceUri, {
564
+ String ideQueryParam = '' ,
565
+ }) {
553
566
return Uri (
554
567
scheme: 'http' ,
555
568
host: _devTools.hostname,
556
569
port: _devTools.port,
557
- queryParameters: {'uri' : debugServiceUri}).toString ();
570
+ queryParameters: {
571
+ 'uri' : debugServiceUri,
572
+ if (ideQueryParam.isNotEmpty) 'ide' : ideQueryParam,
573
+ }).toString ();
558
574
}
559
575
}
560
576
0 commit comments