-
Notifications
You must be signed in to change notification settings - Fork 308
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
Asserts are no longer enabled by default for non-debug sessions #4379
Comments
Hmmm, on the surface this feels like a bug to me. I was under the impression we always ran with asserts enabled from the IDE by default (because I assumed at dev time that's what you'd want), however I can repro this doesn't work and it's because of this Dart-Code/src/extension/providers/debug_config_provider.ts Lines 635 to 636 in 7a2a7cc
It was added during the migration of flags from inside the debug adapter into the VS Code extension (to simplify the new debug adapters), but it doesn't appear to have had this condition when it was in the debug adapter. The change doesn't describe that it was deliberate, although it seems hard to do this accidentally. I'm going to try removing that condition and running the bots and see what happens. In the meantime, if you have a {
"version": "0.2.0",
"configurations": [
{
"name": "dart",
"request": "launch",
"type": "dart",
"toolArgs": [
"--enable-asserts" // enable asserts
],
"templateFor": "", // use as the template for Run/Debug for the whole project (this is a path prefix, empty string matches the entire project)
}
]
} |
@bwilkerson btw I kicked off a pre-release version with this in it earlier. If you're on the pre-release Dart extension and have updated to v3.59.20230208 (note the last digit is an 8, there was a pre-release yesterday ending 7 but otherwise the same) and reloaded, then asserts should be on by default and not need the I can't be certain this change in default behaviour won't upset anyone, but it was the original and intended behaviour. If this poses a problem we can add a setting to make it easier to control without needing a launch configuration. |
There might already be a way to do this that I didn't find, but I would like to be able to run code with asserts enabled without having to be running under the debugger. The primary motivation for not using the debugger is that the code runs slower.
My guess is that this would need to be a preference setting, but I'm happy with any solution you think would be best.
The text was updated successfully, but these errors were encountered: