Improve `makeDefaultTraceLabel`
- Dominant language
- JavaScript
- Stars
- 171
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
Goal: `makeDefaultTraceLabel` is not very useful for most types of expressions, since it only shows the expression itself, which often is the just the variable name. That is not useful when looking for specific interactions of a variable, especially in "Object Traces".
* [ ] Instead, starting from staticTrace `t` keep going upward in the `staticTrace` tree, to find the outer-most `staticTrace` whose `loc` fulfills these conditions:
* It fully contains `t`'s `loc`
* It does not span more than one line
* (if `t` itself spans more than one line, then just return `t`)
* Only iterate for a `maxDistance` amount of times (this is to avoid confusion with very long lines and also with obfuscated code)
Try with `maxDistance = 3` at first?
Contributor guide
Assessment
This issue has not been assessed yet.