This is only the initial PR with a proposal to make Ben.Demystifier aware of F# async engines. Example form the samples folder produces a raw exception stack trace of:
System.Exception: BOOM!
at Program.call@10-1.Invoke(Unit _arg1) in D:\projects\dev\contrib\Ben.Demystifier\sample\FSharpStackTrace\Program.fs:line 11
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, FSharpFunc`2 userCode, b result1) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 417
at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 109
--- End of stack trace from previous location where exception was thrown ---
at Ply.TplPrimitives.TplAwaitable`4.GetNext()
at Ply.TplPrimitives.ContinuationStateMachine`1.System-Runtime-CompilerServices-IAsyncStateMachine-MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Program.main(String[] argv) in D:\projects\dev\contrib\Ben.Demystifier\sample\FSharpStackTrace\Program.fs:line 31
While after this PR:
System.Exception: BOOM!
at async Async<int> Program+call@10-1.() in D:/projects/dev/contrib/Ben.Demystifier/sample/FSharpStackTrace/Program.fs:line 11
at int Program.main(string[] argv) in D:/projects/dev/contrib/Ben.Demystifier/sample/FSharpStackTrace/Program.fs:line 31
Some notes and thoughts:
F# stack traces doesn't seem to be complete. If you'll take a look at sample and demystified stack trace, you'll see, that some of the function calls are lost. This is because they don't show in the original stack traces either. Something that problably could be improved directly in F# compiler I guess.
The entire logic around inclusion/exclusion of method and its formatting feels clunky. I know that this would take a lot of work, but maybe it would be feasible to rearrange Ben.Demystifier around visitor pattern and make demystifier open to user extensions?
This is only the initial PR with a proposal to make Ben.Demystifier aware of F# async engines. Example form the samples folder produces a raw exception stack trace of:
While after this PR:
Some notes and thoughts: