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
Thanks for the details. Currently you can add vmArgs to "-ea" in the launch.json to enable assert. In future, we're planning to expose a global vmArgs in the user settings, where you can add "-ea" as the default value.
Activity
testforstephen commentedon Sep 3, 2020
What's asserts? Please explain your user scenario with more details.
safield commentedon Sep 3, 2020
assert is a keyword in Java, and it behaves like assert does in c++.
https://docs.oracle.com/javase/7/docs/technotes/guides/language/assert.html
They can be enabled normally by adding a flag to java at runtime. They are not enabled by default when debugging using the vscode extension.
testforstephen commentedon Sep 4, 2020
Thanks for the details. Currently you can add vmArgs to "-ea" in the launch.json to enable assert. In future, we're planning to expose a global vmArgs in the user settings, where you can add "-ea" as the default value.
safield commentedon Sep 4, 2020
I currently don't have a launch.json. Should I be expecting one to be present?
testforstephen commentedon Sep 4, 2020
By default, the debugger just generates the config in memory. But you could go the debug view to create a launch.json.
testforstephen commentedon Oct 19, 2020
With the latest debugger, you could achieve this by adding user setting
"java.debug.settings.vmArgs": "-ea".mediad02 commentedon Nov 8, 2021
um is there a way to enable asserts for C#?
testforstephen commentedon Nov 9, 2021
sorry, this extension for Java only. You have to go to C# extension for that.