-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typing the name of a variable / function will now print its value ins… #48
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,9 +83,12 @@ class Executor { | |
log.info('Phase: Evaluate'); | ||
final isolateInfo = await workspaceIsolate.isolateInfo; | ||
final targetId = isolateInfo.rootLib!.id!; | ||
final response = await vm.vmService | ||
Response response = await vm.vmService | ||
.evaluate(workspaceIsolate.isolateId, targetId, _evaluateCode); | ||
|
||
if(response is InstanceRef && response.valueAsString == null) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And please add a test in e2e_test.dart, which is quite simple - just provide some inputs and assert outputs |
||
// InstanceRef.valueAsString only works on primitive values like String, int, double ETC, so for anything else we have to ask the VM to get the toString value | ||
response = await vm.vmService.evaluate(workspaceIsolate.isolateId, response.id!, "this.toString()"); | ||
} | ||
Comment on lines
+88
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about putting this inside _handleEvaluateResponse There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I was doing that at first, but then I saw that it would require complicating the function and making it asynchronous. But now I wonder if we can append a .toString() call directly to the end of the autogenerated method to simplify this. That second response we're sending is probably slowing things down a little. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea! Feel free to PR that
btw do you feel it in real usage or is it a theoretical thinking? |
||
_handleEvaluateResponse(response); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and making it using the original keyword
final
again