In some case pretty-printing still produces long lines
Categories
(DevTools :: Debugger, defect, P2)
Tracking
(firefox114 verified)
Tracking | Status | |
---|---|---|
firefox114 | --- | verified |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Steps to reproduce
- Go to https://ffx-devtools-pretty-print.glitch.me/
- Open the debugger
- Select the
cases/long-lines.js
file - Click the Pretty print icon
Expected results
Those long lines gets chopped-up into multiple, smaller ones
Actual results
The lines are still long after pretty printing
It looks like we could do a better job when expressions are separated by &&
or ||
(especially when we're not in a if
condition)
We could also have better output for ternary conditions
Assignee | ||
Updated•5 months ago
|
Assignee | ||
Updated•5 months ago
|
Assignee | ||
Comment 1•2 months ago
|
||
When dealing with a (
token, we check the next tokens to find the matching
closing paren. In the same time, we compute the length of all the tokens inside
the paren.
If we reach a given length (60 at the moment) without finding the closing paren,
we consider it "long" and will treat it (and the closing paren) as line delimiter.
On top of that, we expand line delimiters to ||
and &&
when there not in a
"short" paren, so we can split up long lines.
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a9f77a7cf26b [devtools] Add line break after parens when content is long. r=devtools-reviewers,bomsy.
Comment 3•2 months ago
|
||
Backed out for dt failure on browser_dbg-pretty-print-inline-scripts.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/c4b9ae0face44b20202b0d90393e408b86336e34
Log link: https://treeherder.mozilla.org/logviewer?job_id=412700138&repo=autoland&lineNumber=4167
Assignee | ||
Comment 4•2 months ago
|
||
ah sorry, i thought I fixed it at some point 🤔
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/62af6f051232 [devtools] Add line break after parens when content is long. r=devtools-reviewers,bomsy.
Comment 6•2 months ago
|
||
bugherder |
Updated•27 days ago
|
Comment 7•24 days ago
|
||
I've reproduced this issue using Nightly 114.0a1 (2023-04-15) on Windows 10 x64 following the STR from Comment 0.
Verified as fixed on the latest Firefox 114.0b3 version on Windows 10, macOS 13 and Ubuntu 22.04, where the issue no longer persists.
Description
•