Support call stacks in test failures #222126
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements API and UI support for call stacks in test messages. For an extension who doesn't adopt the new API, nothing changes. When a call stack is available, you get a multi-editor view inspired by the multidiff view. This appears both in the peek and Test Results view.
It is implemented in a way that the call stack itself is generic and can be reused by debug in the future, and it borrows some UI from debug land:
The editors are readonly,
simple
monaco editors. There is never nested scrolling unless the test failure is >1000 lines, until that point the editor expands to fit its content. Clicking on either the title or "go to file" action brings the user to that location from the call stack. The top of the stack (the failure message) has quick actions to re-run the test or debug the test. A very handy flow is setting a breakpoint in the first call frame within the peek and hitting the "debug" button to quickly debug to that failure. Followup actions are shown (see the "fix with copilot" action in the screenshot)Overall I'm really liking this UI. It does feel kind of heavy to be in a peek, but the utility is there.