Smart Step Into debugging in Rider
In a recent talk I gave about Rider’s debugger, one of the things I mentioned is that while writing code, we spend a lot of time in the debugger to validate our logic. Because of this reality, debugging should be as painless as possible. With Rider 2017.3 EAP, we’re introducing Smart Step Into to make debugging lines with multiple statements easier.
While in the debugger, we may sometimes reach a line of code that performs several method calls. Let’s take this line of code as an example:
PrintPeople(FilterPeople(people, BuildPredicate(person => person.Company.Country, "CZ")));
If we’d want to step into
FilterPeople(), we’d first have to step through
BuildPredicate() before we get to the method we want to debug:
That works, but it does bring some overhead by having to mentally context-switch through another method than the one we really wanted to debug.
Smart Step Into solves this problem by letting us pick the function we want to step into. We can invoke Smart Step Into from the Run | Smart Step Into menu or by pressing Shift+F7:
When selecting a method using Smart Step Into, other methods will be ignored until code execution reaches the method we are interested in. This helps us keep focus on the task at hand, instead of having to follow an entire call chain we’re not interested in.