mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
Revert "Send DAP events through DDS"
This reverts commit 5292ee8839
.
Reason for revert: Causes failure on `sse_smoke_test` because it needs to set up an event handler.
Original change's description:
> Send DAP events through DDS
>
> Change-Id: Ib40306b8e47d74b02b6cbf348c2b5833cfb31a9d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309080
> Commit-Queue: Helin Shiah <helinx@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>
Change-Id: I62b12de8e2478441d9a7a4177ed1090aa845467f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310740
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
This commit is contained in:
parent
c3f3a00465
commit
02b10e1321
|
@ -1,6 +1,3 @@
|
|||
# 2.9.2
|
||||
- Added notifications for DAP events.
|
||||
|
||||
# 2.9.1
|
||||
- [DAP] `runInTerminal` requests are now sent after first responding to the `launchRequest`.
|
||||
- [DAP] Skipped tests are now marked with `!` instead of `✓` in `Output` events.
|
||||
|
|
|
@ -19,7 +19,6 @@ class DdsHostedAdapter extends DartDebugAdapter<DartLaunchRequestArguments,
|
|||
DartAttachRequestArguments>
|
||||
with PidTracker, VmServiceInfoFileUtils, PackageConfigUtils, TestAdapter {
|
||||
Uri? ddsUri;
|
||||
void Function(Event)? eventHandler;
|
||||
|
||||
@override
|
||||
final parseLaunchArgs = DartLaunchRequestArguments.fromJson;
|
||||
|
@ -122,17 +121,4 @@ class DdsHostedAdapter extends DartDebugAdapter<DartLaunchRequestArguments,
|
|||
throw potentialException;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void sendEventToChannel(Event event) {
|
||||
if (eventHandler == null) {
|
||||
throw Exception("No event handler for DDS hosted adapter");
|
||||
} else {
|
||||
eventHandler!(event);
|
||||
}
|
||||
}
|
||||
|
||||
void setEventHandler(void Function(Event) eventHandler) {
|
||||
this.eventHandler = eventHandler;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -205,10 +205,6 @@ abstract class BaseDebugAdapter<TLaunchArgs extends LaunchRequestArguments,
|
|||
event: eventType ?? eventTypes[body.runtimeType]!,
|
||||
body: body,
|
||||
);
|
||||
sendEventToChannel(event);
|
||||
}
|
||||
|
||||
void sendEventToChannel(Event event) {
|
||||
_channel.sendEvent(event);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:dds_service_extensions/dap.dart';
|
||||
import 'package:json_rpc_2/json_rpc_2.dart' as json_rpc;
|
||||
|
||||
import '../dap.dart';
|
||||
|
@ -44,20 +41,8 @@ class DapHandler {
|
|||
};
|
||||
}
|
||||
|
||||
_handleEvent(Event event) {
|
||||
dds.streamManager.streamNotify(DapEventStreams.kDAP, {
|
||||
'streamId': DapEventStreams.kDAP,
|
||||
'event': {
|
||||
'kind': DapEventKind.kDAPEvent,
|
||||
'timestamp': DateTime.now().millisecondsSinceEpoch,
|
||||
'dapData': jsonEncode(event),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _startAdapter(DdsHostedAdapter adapter) async {
|
||||
adapter.ddsUri = dds.uri;
|
||||
adapter.setEventHandler(_handleEvent);
|
||||
|
||||
// TODO(helin24): Most likely we'll want the client to do these
|
||||
// initialization steps so that clients can differentiate capabilities. This
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: dds
|
||||
version: 2.9.2
|
||||
version: 2.9.1
|
||||
description: >-
|
||||
A library used to spawn the Dart Developer Service, used to communicate with
|
||||
a Dart VM Service instance.
|
||||
|
@ -13,8 +13,8 @@ dependencies:
|
|||
async: ^2.4.1
|
||||
browser_launcher: ^1.0.0
|
||||
collection: ^1.15.0
|
||||
dds_service_extensions: ^1.6.0
|
||||
dap: ^1.6.0
|
||||
dds_service_extensions: ^1.3.0
|
||||
dap: ^1.0.0
|
||||
devtools_shared: ^2.14.1
|
||||
http_multi_server: ^3.0.0
|
||||
json_rpc_2: ^3.0.0
|
||||
|
@ -27,7 +27,7 @@ dependencies:
|
|||
sse: ^4.0.0
|
||||
stack_trace: ^1.10.0
|
||||
stream_channel: ^2.0.0
|
||||
vm_service: '>=11.7.2 <12.0.0'
|
||||
vm_service: '>=11.0.0 <12.0.0'
|
||||
web_socket_channel: ^2.0.0
|
||||
|
||||
# We use 'any' version constraints here as we get our package versions from
|
||||
|
|
|
@ -7,7 +7,7 @@ import 'dart:io';
|
|||
|
||||
import 'package:dap/dap.dart';
|
||||
import 'package:dds/dds.dart';
|
||||
import 'package:dds_service_extensions/dap.dart';
|
||||
import 'package:dds_service_extensions/src/dap.dart';
|
||||
import 'package:test/test.dart';
|
||||
import 'package:vm_service/vm_service_io.dart';
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
## 1.6.0
|
||||
- Made DAP extensions methods accessible in lib.
|
||||
|
||||
## 1.5.0
|
||||
- Added `DdsExtension.postEvent`.
|
||||
|
||||
|
|
|
@ -29,8 +29,6 @@ extension DapExtension on vm.VmService {
|
|||
vm.addTypeFactory('DapResponse', DapResponse.parse);
|
||||
_factoriesRegistered = true;
|
||||
}
|
||||
|
||||
Stream<vm.Event> get onDAPEvent => onEvent(DapEventStreams.kDAP);
|
||||
}
|
||||
|
||||
class DapResponse extends vm.Response {
|
||||
|
@ -52,19 +50,3 @@ class DapResponse extends vm.Response {
|
|||
|
||||
final dap.Response dapResponse;
|
||||
}
|
||||
|
||||
extension DapEvents on vm.Event {
|
||||
dap.Event get dapData {
|
||||
assert(json != null);
|
||||
return dap.Event.fromJson(json!['dapData']);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class DapEventStreams extends vm.EventStreams {
|
||||
static const String kDAP = 'DAP';
|
||||
}
|
||||
|
||||
abstract class DapEventKind extends vm.EventKind {
|
||||
/// Notification that a DAP event occurred.
|
||||
static const String kDAPEvent = 'DAPEvent';
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
name: dds_service_extensions
|
||||
version: 1.6.0
|
||||
version: 1.5.0
|
||||
description: >-
|
||||
Extension methods for `package:vm_service`, used to make requests a
|
||||
Dart Development Service (DDS) instance.
|
||||
|
@ -11,7 +11,7 @@ environment:
|
|||
dependencies:
|
||||
async: ^2.4.1
|
||||
dap: ^1.0.0
|
||||
vm_service: ^11.7.2
|
||||
vm_service: ^11.0.0
|
||||
|
||||
# We use 'any' version constraints here as we get our package versions from
|
||||
# the dart-lang/sdk repo's DEPS file. Note that this is a special case; the
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
## 11.7.2
|
||||
- Make Event classes abstract to permit `dap` event stream extensions.
|
||||
|
||||
## 11.7.1
|
||||
- Expose RPC error codes that were defined in `package:dds`.
|
||||
|
||||
|
|
|
@ -2834,7 +2834,9 @@ class ErrorKind {
|
|||
}
|
||||
|
||||
/// An enum of available event streams.
|
||||
abstract class EventStreams {
|
||||
class EventStreams {
|
||||
EventStreams._();
|
||||
|
||||
static const String kVM = 'VM';
|
||||
static const String kIsolate = 'Isolate';
|
||||
static const String kDebug = 'Debug';
|
||||
|
@ -2851,7 +2853,9 @@ abstract class EventStreams {
|
|||
|
||||
/// Adding new values to `EventKind` is considered a backwards compatible
|
||||
/// change. Clients should ignore unrecognized events.
|
||||
abstract class EventKind {
|
||||
class EventKind {
|
||||
EventKind._();
|
||||
|
||||
/// Notification that VM identifying information has changed. Currently used
|
||||
/// to notify of changes to the VM debugging name via setVMName.
|
||||
static const String kVMUpdate = 'VMUpdate';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: vm_service
|
||||
version: 11.7.2
|
||||
version: 11.7.1
|
||||
description: >-
|
||||
A library to communicate with a service implementing the Dart VM
|
||||
service protocol.
|
||||
|
|
Loading…
Reference in a new issue