vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Improve navigating test failure call stacks

Open eylvisaker opened this issue 4 months ago • 0 comments

Is your feature request related to a problem? Please describe.

I am frequently frustrated when I'm running tests in VSCode and I click on a failed test and it goes to the very top of the callstack where the failure occurred. I often have assertion helper methods with names like VerifyParagraph() that help simplify writing tests by collecting common behaviors. Although the asserts exist within these method, the test problems almost never occur there, and landing in this method just does not provide helpful context. Often times a reason for a test failure does not occur in the same location as the exception was thrown, but having VSCode constantly push me to the line of the exception is really disruptive to my flow.

(For clarification: I'm using top of the call stack to refer to the function where the exception was thrown, and bottom of the call stack to refer to the entry point of the test method)

Describe the solution you would like

What I actually want is to have more precise control over navigating the call stack for a test failure. This should include the following:

  • There should be an option somewhere that allows me to configure whether clicking on a failed test in the test explorer goes to the top or bottom of the call stack. (IMHO this should default to the bottom of the callstack, not the top)

  • Clicking on a failure marker : Image This should not adjust my position at all. It should just open the display of the callstack so I can read it. Currently clicking on this navigates to the top of the callstack, but when I click on this I want the details of the failure, not to navigate through the source.

  • The inset that shows test failure details: Image ** The arrow buttons in the top right allow me to navigate between different test failures, which is redundant with the list of test failures that are right below. What's missing from here is a way to navigate up and down the call stack - this would be really useful. ** The button to navigate to the bottom of the call stack is buried in the content, a long exception message pushes that off the bottom requiring scrolling down to reach it. ** There is no word wrap here, so long exception messages or source lines are hidden under the right pane. There is no horizontal scrollbar either, so I can only see long messages by clicking into the box and then navigating with the keyboard.

Applicable Scenarios

Test failures that occur in a dotnet project.

Describe alternatives you've considered

Using Rider. I like VSCode for everything else, but this is maddening.

eylvisaker avatar Jun 22 '25 17:06 eylvisaker