Skip to content

Commit 638c89e

Browse files
author
Anna Gringauze
authored
Implement new getSourceReport parameter (#1598)
1 parent 47dd82c commit 638c89e

File tree

7 files changed

+52
-26
lines changed

7 files changed

+52
-26
lines changed

dwds/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 14.0.1-dev
2+
- Add `libraryFilters` optional parameter to the vm service implememtation
3+
of `getSourceReport`.
4+
15
## 14.0.0
26
- Add column information to breakpoints to allow precise breakpoint placement.
37
- Split SDK validation methods to allow validation of separate components.

dwds/lib/src/debugging/inspector.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,16 @@ function($argsString) {
428428
/// Return the VM SourceReport for the given parameters.
429429
///
430430
/// Currently this implements the 'PossibleBreakpoints' report kind.
431-
Future<SourceReport> getSourceReport(String isolateId, List<String> reports,
432-
{String scriptId,
433-
int tokenPos,
434-
int endTokenPos,
435-
bool forceCompile,
436-
bool reportLines}) {
431+
Future<SourceReport> getSourceReport(
432+
String isolateId,
433+
List<String> reports, {
434+
String scriptId,
435+
int tokenPos,
436+
int endTokenPos,
437+
bool forceCompile,
438+
bool reportLines,
439+
List<String> libraryFilters,
440+
}) {
437441
checkIsolate('getSourceReport', isolateId);
438442

439443
if (reports.contains(SourceReportKind.kCoverage)) {

dwds/lib/src/injected/client.js

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

dwds/lib/src/services/chrome_proxy_service.dart

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -562,20 +562,28 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
562562
}
563563

564564
@override
565-
Future<SourceReport> getSourceReport(String isolateId, List<String> reports,
566-
{String scriptId,
567-
int tokenPos,
568-
int endTokenPos,
569-
bool forceCompile,
570-
bool reportLines}) async {
565+
Future<SourceReport> getSourceReport(
566+
String isolateId,
567+
List<String> reports, {
568+
String scriptId,
569+
int tokenPos,
570+
int endTokenPos,
571+
bool forceCompile,
572+
bool reportLines,
573+
List<String> libraryFilters,
574+
}) async {
571575
return await captureElapsedTime(() async {
572576
await isInitialized;
573-
return await _inspector?.getSourceReport(isolateId, reports,
574-
scriptId: scriptId,
575-
tokenPos: tokenPos,
576-
endTokenPos: endTokenPos,
577-
forceCompile: forceCompile,
578-
reportLines: reportLines);
577+
return await _inspector?.getSourceReport(
578+
isolateId,
579+
reports,
580+
scriptId: scriptId,
581+
tokenPos: tokenPos,
582+
endTokenPos: endTokenPos,
583+
forceCompile: forceCompile,
584+
reportLines: reportLines,
585+
libraryFilters: libraryFilters,
586+
);
579587
}, (result) => DwdsEvent.getSourceReport());
580588
}
581589

dwds/lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dwds/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: dwds
22
# Every time this changes you need to run `dart run build_runner build`.
3-
version: 14.0.0
3+
version: 14.0.1-dev
44
description: >-
55
A service that proxies between the Chrome debug protocol and the Dart VM
66
service protocol.

dwds/test/chrome_proxy_service_test.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,16 @@ void main() {
867867
service.getSourceReport(isolateId, ['Coverage']), throwsRPCError);
868868
});
869869

870+
test('Coverage report', () async {
871+
var vm = await service.getVM();
872+
var isolateId = vm.isolates.first.id;
873+
874+
await expectLater(
875+
service.getSourceReport(isolateId, ['Coverage'],
876+
libraryFilters: ['foo']),
877+
throwsRPCError);
878+
});
879+
870880
test('report type not understood', () async {
871881
var vm = await service.getVM();
872882
var isolateId = vm.isolates.first.id;

0 commit comments

Comments
 (0)