Domiii / Domiii/dbux

Improve `makeDefaultTraceLabel`

Open
#490 2 comments 0 reactions 1 assignee Claimed by @MiccWan View on GitHub
enhancement
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

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.