Closed Bug 1815497 Opened 2 years ago Closed 2 years ago

Stop updating symbols from pretty print actions

Categories

(DevTools :: Debugger, task)

task

Tracking

(firefox112 fixed)

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(1 file)

There is only two callsites for setSymbols action:
https://searchfox.org/mozilla-central/search?q=setSymbols%28&path=devtools%2F&case=true&regexp=false
We should only be fetching symbols from selectLocation as pretty print action ends up calling selectLocation anyway.
This will reduce the concurrent calls to setSymbols and simplify the overall comprehension of when we are fetching symbols/parsing AST.

While doing that, we can cleanup a few things in pretty print actions.

  • remove prettyPrint.spec.js as it only contains trivial assertions mostly covered by mochitests.
    Duplicated calls to toggle pretty print to the same source has been converted to a mochitest (browser_dbg-pretty-print-flow.js).
    But we can't easily replicate the exact same assertion as the assert() from togglePrettyPrint only thows on Node...
    I tweaked assert module to highlight how to try enabling it on mochitests via flags.testing.

    Removing this jest test helps remove useless export of createPrettyPrintSource, better highlighting the external API of prettyPrint.js
    About the mochitest, awaiting for togglePrettyPrint makes it useless to wait asynchronously for tabs opening.

  • I removed a jest test from project-text-search.spec.js which started failing
    and should already be covered by mochitests?

  • about selectPrettyLocation, we do not need to pass the generatedLocation argument,
    as this is always the currently selected location. Also we were selecting it once,
    mostly to force the loading of the original/pretty source via selectSource().
    And then we were calling selectSpecificLocation a second time.
    We could select the source only once, if we force loading the original source first.
    We only need to populate the SourceMapLoader before trying to update the selection.
    This change may slow down the display of pretty printed source, but should avoid intermittents
    and unexpected changes of selected location.

  • last but not least, setSymbols can be removed as this is done when calling selectLocation.
    This was the main goal, so that we can revise setSymbols more easily in following patches.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ef81e4fd7d44 [devtools] Simplify a few things around pretty printing. r=devtools-reviewers,nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
Regressions: 1817728
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: