You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Developer logs not showing up on the debug console anymore while running using the 'Run Without Debugging' option #4875
Describe the bug
Outputs of the log() function from dart:developer import is not showing up at the debug console anymore unless you run the app using "Run > Start Debugging". This was not the case before, I was able to see the logs on my console using "Run > Run Without Debugging" option.
I sometimes need to output long data on my console but this is not seem to be possible using print() since it truncates the text. I also don't want to use debugging mode while developing my application because the app runs too slow and it gets interrupted for every exception.
Expected behavior
Log output to be displayed on debug console.
Please complete the following information:
You can run the Dart: Collect Diagnostic Information command from the VS Code command palette (F1) to easily capture this information or provide it manually.
Operating System and version: macOS Sonoma 14.1.2
VS Code version: 1.84.2
Dart extension version: v3.78.0
Dart/Flutter SDK version: 3.16.2
Target device (if the issue relates to Flutter debugging): iOS Simulator, macOS, Android Emulator, Web
Thanks for the details - This is currently expected behaviour. Running with "Run" does not connect to the VM Service so functionality that requires a VM Service connection is not available. This was always the case for Dart, but the legacy debug adapters did used to connect the debugger even in noDebug mode.
I've opened #4876 to document and review the specifics here. It may be that "connecting the VM Service" is not the best place to draw this line between Run/Debug, but we should review (and document) exactly which functionality should be affected by this.
I also don't want to use debugging mode while developing my application because the app runs too slow and it gets interrupted for every exception.
You can choose whether or not the debugger breaks on exceptions here:
If you untick those options, it will not pause on exceptions. I'm unsure what kind of performance difference you're seeing, but if it's caused by connecting the VM Service then they may appear in Run mode if we connect the debugger. If you can provide some more concrete details on the performance difference you see, we can figure out whether it's caused by something in the debug connection.
I'll close this as a dupe of #4876 because I think any changes should come out of that rather than just reverting this change.
Since this issue (and a related issue with Widget Inspector navigation #4878) came up a few times, we've decided to apply a patch that resolves this by making the "Start without Debugging" option work more like "Start with Debugging" (that is, it will always connect to the VM Service).
The fix is already included in the pre-release version of the extension and I'll push later this week or early next week if nothing comes up.
If you want to try it out, you can switch to the pre-release versions with these button in VS Code:
Activity
DanTup commentedon Dec 4, 2023
Thanks for the details - This is currently expected behaviour. Running with "Run" does not connect to the VM Service so functionality that requires a VM Service connection is not available. This was always the case for Dart, but the legacy debug adapters did used to connect the debugger even in noDebug mode.
I've opened #4876 to document and review the specifics here. It may be that "connecting the VM Service" is not the best place to draw this line between Run/Debug, but we should review (and document) exactly which functionality should be affected by this.
You can choose whether or not the debugger breaks on exceptions here:
If you untick those options, it will not pause on exceptions. I'm unsure what kind of performance difference you're seeing, but if it's caused by connecting the VM Service then they may appear in Run mode if we connect the debugger. If you can provide some more concrete details on the performance difference you see, we can figure out whether it's caused by something in the debug connection.
I'll close this as a dupe of #4876 because I think any changes should come out of that rather than just reverting this change.
DanTup commentedon Dec 6, 2023
Since this issue (and a related issue with Widget Inspector navigation #4878) came up a few times, we've decided to apply a patch that resolves this by making the "Start without Debugging" option work more like "Start with Debugging" (that is, it will always connect to the VM Service).
The fix is already included in the pre-release version of the extension and I'll push later this week or early next week if nothing comes up.
If you want to try it out, you can switch to the pre-release versions with these button in VS Code:
DanTup commentedon Dec 11, 2023
This issue is resolved in v3.78.2 of the Dart extension. Please update and click the "Reload" button if prompted.