devtools
Support evaluation for running app.
#5248
Merged

Support evaluation for running app. #5248

polina-c merged 6 commits into flutter:master from polina-c:eval1
polina-c
polina-c2 years ago (edited 2 years ago)
Screen.Recording.2023-02-14.at.8.14.57.AM.mov
polina-c -
c5e6f8f2
polina-c polina-c requested a review 2 years ago
polina-c polina-c removed review request 2 years ago
polina-c polina-c requested a review from kenzieschmoll kenzieschmoll 2 years ago
polina-c Update NEXT_RELEASE_NOTES.md
65c454c0
polina-c Merge branch 'master' of github.com:flutter/devtools into eval1
fc90a5f6
kenzieschmoll
kenzieschmoll commented on 2023-02-14
Conversation is marked as resolved
Show resolved
packages/devtools_app/lib/src/shared/console/eval/eval_service.dart
6060 return await _service.getObject(ref, objRef.id!);
6161 }
6262
63
Future<Response> evalInRunningApp(
kenzieschmoll2 years ago👍 1

Can you add some dart doc to this describing that this evaluation occurs in the isolate's root library?

kenzieschmoll
kenzieschmoll commented on 2023-02-14
Conversation is marked as resolved
Show resolved
packages/devtools_app/lib/src/shared/console/widgets/evaluate.dart
313 response = await evalService.evalAtCurrentFrame(expressionText);
314 } else {
315 response =
316
await evalService.evalInRunningApp(isolateRef!, expressionText);
kenzieschmoll2 years ago👍 1

should we be null asserting isolateRef? asking because _emitRefToConsole allows a nullable isolate below. Maybe we should add a null check if we cannot call the eval on a null isolate

kenzieschmoll
kenzieschmoll2 years ago

Work towards #4069

polina-c -
2f6e91e6
polina-c Merge branch 'master' of github.com:flutter/devtools into eval1
e4309e17
kenzieschmoll
kenzieschmoll commented on 2023-02-14
Conversation is marked as resolved
Show resolved
packages/devtools_app/lib/src/shared/console/widgets/evaluate.dart
313313 response = await evalService.evalAtCurrentFrame(expressionText);
314314 } else {
315 if (isolateRef == null) {
316
_emitToConsole('Isolate should be defined for evaluation.');
kenzieschmoll2 years ago👍 1

nit: "Cannot evaluate expression because the selected isolate is null."

kenzieschmoll
kenzieschmoll approved these changes on 2023-02-14
kenzieschmoll2 years ago

one comment on wording, but lgtm

polina-c Update evaluate.dart
757d969c
kenzieschmoll
kenzieschmoll commented on 2023-02-14
packages/devtools_app/lib/src/shared/console/widgets/evaluate.dart
315308 try {
316309 // Response is either a ErrorRef, InstanceRef, or Sentinel.
317310
final isolateRef = serviceManager.isolateManager.selectedIsolate.value;
318
final response = await evalService.evalAtCurrentFrame(expressionText);
311
final Response response;
312
if (serviceManager.isMainIsolatePaused) {
kenzieschmoll2 years ago

Is it possible for the main isolate to be paused but the selectedIsolate to be unpaused? Shouldn't we be evaluating in the selected isolate, not the main (in the event that these are different)?

polina-c polina-c merged 0d06de3d into master 2 years ago
polina-c polina-c deleted the eval1 branch 2 years ago

Login to write a write a comment.

Login via GitHub

Reviewers
Assignees
No one assigned
Labels
Milestone