Stop updating symbols from pretty print actions
Categories
(DevTools :: Debugger, task)
Tracking
(firefox112 fixed)
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®exp=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.
Assignee | ||
Comment 1•2 years ago
|
||
-
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() fromtogglePrettyPrint
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 viaselectSource()
.
And then we were callingselectSpecificLocation
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 callingselectLocation
.
This was the main goal, so that we can revisesetSymbols
more easily in following patches.
Updated•2 years ago
|
Comment 3•2 years ago
|
||
bugherder |
Description
•