dotnet / dotnet/fsharp

`Tracking` Compiler debuggability improvements

Open
#13,424 2 comments 0 reactions 0 assignees View on GitHub
Contributor Pain Engineering Tracking
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

> **Note**
> This is a "meta" issue for tracking purposes, since GitHub does not support special types of issues.

During a compiler debugging session with @dsyme, we've identified a few points which need improvements:

- `reqdTy` (may `TType` instances) is showed as `solved` with no information, show solution when possible (possibly, show solution depth).
- NOTE: `range`'s `ToString` will go to the filesystem and read the file. We can also reduce the text (10 characters?)
- Debugger is slow expanding object with bunch of properties (for example `TType`).
- Search codebase for `ToString`, have them consistent (having a simple string representing the type).
- Putting `.ToString()` with simpler info, consistently across types, rather than type name to:
- TyparFlags
- XmlDoc
- CallerArg
- CalledArg
- AssignedCalledArg
- cenv, TcEnv (inconsistent ToString()), TcGlobals, TcImports, TcState
- DispayEnv, NameResolutionEnv should deliver a simple string, instead of `%A`
- AccessorDomain, AccessibleFrom, CompPath - simpler ToString().
- ... review types of `MethodCalls.fs`.
- Review all of `Syn*` types.
- Review test framework `ToString`s (e.g. CompilationSource and CompilationUnit).
- Consider putting `DebuggerStepThrough` (helps debugging experience by not stepping into functions/methods), `DebuggerHidden` (hide stack frames) or `DebuggerNonUserCode`.
- We need to review current compiler stacktraces and _remove_ higher-order functions, for example:
- `DiagnosticLogger.fs` - `TryD`, `MapD`, `MapD.loop`, `MapCombineTDC2D`, `MapCombineTDCD` `StackGuard.Guard` and others.
- `ConstraintSolver` - `CollectThenUndoOrCommit`
- Consider adding `NonUserCode` to the library functions (like `map`, `fold`, etc.)? This may complicate debugging `FSharp.Core` itself.
- Consider using `DebuggerHidden` and/or `NonUserCode` on `StartWithContinuationsUsingDispatchInfo`, `StartWithContinuations` and `StartImmediate`.
- Make `_FullList` null if the length is `<= ListDebugViewMaxLength`:

```fsharp
[]
member x._FullList = items (count l 0 ListDebugViewMaxFullLength)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.