Dart-code: Support global expression evaluation inc. while not paused

Created on 16 May 2018  路  19Comments  路  Source: Dart-Code/Dart-Code

This was less useful for Dart, but for Flutter it could be useful to interact with an app while it's not paused on a breakpoint.

in debugger is enhancement

Most helpful comment

@AndreVNP me too facing the same issue..Please post the solution, if you have solved this issue

All 19 comments

We need to send a library (or class) for evaluation, and the debug adapter doesn't have one - to do that we'd need to let the debugger ask the editor where the user is - starting to feel messy. Will come back to this..

Still not working

image

@AndreVNP me too facing the same issue..Please post the solution, if you have solved this issue

I have the same problem in Visual Studio Code using Dart..
Please Help

This is not currently possible. To evaluate expressions, you'll need to be stopped at a breakpoint for now.

Any solution yet?
did anyone solve this?

Next version will partially support this... The global evaluations will always be scoped to the "root library" on the root isolate (this will usually be your main.dart). I've opened a separate issue (#2446) for having it scoped to the active file in the editor, but that's a little more tricky (since the debug adapter does not know which file is active in the editor).

Screenshot 2020-05-12 at 10 09 06

Hopefully this handles most use cases, though I'm not completely familiar with what everyone is trying to use this for, so feel free to post your requirements here and I'll try to cover those I can.

Thanks!

Next version will partially support this... The global evaluations will always be scoped to the "root library" on the root isolate (this will usually be your main.dart). I've opened a separate issue (#2446) for having it scoped to the active file in the editor, but that's a little more tricky (since the debug adapter does not know which file is active in the editor).

Screenshot 2020-05-12 at 10 09 06

Hopefully this handles most use cases, though I'm not completely familiar with what everyone is trying to use this for, so feel free to post your requirements here and I'll try to cover those I can.

Thanks!

Thanks a bunch for looking into this.
is there a beta version with a fix we could support ourselves with while its not yet ready for release?

There's a preview build here:

https://github.com/Dart-Code/Dart-Code/releases/tag/v3.11.0-beta.1

Install by downloading the attached vsix file and running the Extensions: Install from VSIX command from the VS Code Command Palette to select the vsix file and then reload VS Code.

It is still not working..
can anyone please help me out to get some solution on this!

image

@sarthak260 you're typing into the evaluation console here. If you want to accept input from the user for your Dart program, you need to configure your launch configuration to run in the terminal .- please see https://dartcode.org/releases/v3-9/#dart-cli-terminal-improvements

@DanTup you are right. In launch.json file, "Console" : "Terminal", it is working.
https://dartcode.org/releases/v3-9/#dart-cli-terminal-improvements

but what does I need to put in my main.dart in order to prevent by terminating the output

@Aung-Thiha112 if you're running a standard Dart script, you're likely better just adding a breakpoint. Flutter apps don't quit at the end of running the entry point, so that's where this request mostly came up.

@sarthak260 you're typing into the evaluation console here. If you want to accept input from the user for your Dart program, you need to configure your launch configuration to run in the terminal .- please see https://dartcode.org/releases/v3-9/#dart-cli-terminal-improvements

I add in launch.json file --> "console" : "terminal" . don't work dart version 3.19.2

@Sormox could you file a new issue, and provide a detailed description of what you mean by it not working? Thanks!

im using dart 3.20.1 "console" : "terminal" dint work and still same erorr why? im using vscode extention

@Rafieaydin it's not clear what what the issue is - the note about using terminal is for accepting input from user, not for global evaluation. If you file a new issue with a detailed description of what you're doing/seeing, I'll take a look. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CaferPoyrazoglu picture CaferPoyrazoglu  路  4Comments

FeimiSzy picture FeimiSzy  路  4Comments

atreeon picture atreeon  路  5Comments

mayorbyrne picture mayorbyrne  路  5Comments

lukepighetti picture lukepighetti  路  4Comments