Closed
Bug 1134798
Opened 10 years ago
Closed 5 years ago
Correct line isn't jumped to when clicking the line for a pretty printed source
Categories
(DevTools :: Debugger, defect, P2)
DevTools
Debugger
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bgrins, Unassigned)
References
(Blocks 1 open bug)
Details
After I pretty print a source, I'd like to clicking on the line number to jump to the correct line number in the debugger.
STR:
Open http://bgrins.github.io/devtools-demos/debugger/scripts.html
Start profiling
Stop profiling
Click on "JavaScript" tab
Click on one of the jquery-2.1.3.min.js lines (takes you to debugger panel)
Stop blackboxing the source
Pretty print source
At this point the cursor should move to the correct line. At the least, if I flip back to the performance tool and click on the same line number again it should open to the correct place.
Comment 2•10 years ago
|
||
I suspect this is a debugger issue, as any tool trying to select a line in the debugger will run into this (profiler data, console logs, etc just have the original line number). Adding a method in Debugger (highlightLine()?) that takes a url and line, if pretty printed convert the number to the new line position, and then select that line on the Editor instance.
Not sure of pretty print provides mappings of line positions?
If this happens, we'll have to update shared/source-utils.js as well to use this method (from bug 1134778)
Blocks: 1153412
Component: Developer Tools: Performance Tools (Profiler/Timeline) → Developer Tools: Debugger
Reporter | ||
Comment 3•10 years ago
|
||
(In reply to Jordan Santell [:jsantell] [@jsantell] from comment #2)
> I suspect this is a debugger issue, as any tool trying to select a line in
> the debugger will run into this (profiler data, console logs, etc just have
> the original line number).
Hm, we may be seeing the same thing in Bug 1045237 then.
> Adding a method in Debugger (highlightLine()?)
> that takes a url and line, if pretty printed convert the number to the new
> line position, and then select that line on the Editor instance.
From what I understand, doing that conversion may be related to source map support in the web console (Bug 670002).
Comment 4•10 years ago
|
||
Yeah, guessing bug 1045237 is a similar issue.
I don't think bug 670002 is related, as the debugger should be able to handle mapping to a line regardless. Any tool that wants to link to the debugger shouldn't have to deal with source maps, and a scenario can occur where you have a link to a minified file, subsequently pretty print it, and that original link should still work. Imagining a method on the debugger:
Debugger.selectLine(line, { isSourceMap })
Updated•6 years ago
|
Product: Firefox → DevTools
Updated•6 years ago
|
Blocks: dbg-prettyprint-m2
Comment 6•5 years ago
|
||
Should I report a separate bug for the same issue with CSS pretty-printing? When I jump from element inspector to Style Editor, it always jumps to line 1, even if aautomatic reformatting puts the relevant CSS rule on a different line.
Comment 7•5 years ago
|
||
sure
Updated•5 years ago
|
Priority: -- → P2
Comment 8•5 years ago
|
||
Simpler STR:
- Open https://debugger-pretty-print-events-1532240.glitch.me/
- Click console reference
Added click handler compressed.js:17:28
… opens Debugger - Pretty-print file
AR: First line is highlighted
ER: Line with console.log
is focused
Comment 9•5 years ago
|
||
This was fixed by https://phabricator.services.mozilla.com/D48812
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•