kmfsousa
kmfsousa

Reputation: 233

IntelliJ IDEA Bazel Test: How to stop optimizing out variables while at a breakpoint in the debugger?

When debugging our Kotlin code while running a test, hitting a breakpoint shows some values get optimized out if they are not called further down in the scope. While ideal for complied code, this is a hindrance for the development of the tests. Is there a setting somewhere to turn this off?

Assuming this is related to the Bazel for IntelliJ plugin but it may be an IntelliJ feature itself, I'm unsure.

The only solution we have found is to add println's before return for the variable we care about. Below is an example where I wanted to see collectionIds.

Optimized out variables

Upvotes: 2

Views: 122

Answers (0)

Related Questions