fix: Forcefully load stacktrace if assert UI is shown (#2164)

- Add DiagnosticUtil to automatically filter out the "boring" stack entries.

Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
This commit is contained in:
KazWolfe 2025-01-09 13:11:41 -08:00 committed by GitHub
parent a656fefb2b
commit bed591d890
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 36 additions and 1 deletions

View file

@ -82,7 +82,7 @@ internal class AssertHandler : IDisposable
if (!this.ShowAsserts && !this.everShownAssertThisSession)
return;
Lazy<string> stackTrace = new(() => new StackTrace(3).ToString());
Lazy<string> stackTrace = new(() => DiagnosticUtil.GetUsefulTrace(new StackTrace()).ToString());
if (!this.EnableVerboseLogging)
{
@ -133,6 +133,9 @@ internal class AssertHandler : IDisposable
return $"https://github.com/{userName}/{repoName}/blob/{branch}/{fileName}#L{line}";
}
// grab the stack trace now that we've decided to show UI.
_ = stackTrace.Value;
var gitHubUrl = GetRepoUrl();
var showOnGitHubButton = new TaskDialogButton
{