debugger icon indicating copy to clipboard operation
debugger copied to clipboard

[prettyPrint] prettifing should remember the user intent to jump to a specific line

Open digitarald opened this issue 9 years ago • 11 comments

Affordability issue I noticed in https://github.com/devtools-html/debugger.html/issues/3777

STR

  • Open https://www.facebook.com/?pagelet_ts=1 (logged out)
  • Click one of the first logs in the Console (BigPipe/init …) to jump to the file
  • Prettify the file
  • ~Old steps~
    • ~Open console on bbc.com/news~
    • ~Click source for formatted log (was init.js:1:11836 for me)~
    • ~Prettify init.js in Debugger~

Actual

Source is prettified but debugger forgot that the user wanted to navigate to specific position in the file,

Expected

After prettify is done the file should jump to the console.log position that the user wanted to go to.

digitarald avatar Aug 24 '17 21:08 digitarald

/claim

lukaszsobek avatar Dec 02 '17 21:12 lukaszsobek

Thanks for claiming the issue! :wave:

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Dec 02 '17 21:12 claim

/unclaim

lukaszsobek avatar Dec 12 '17 19:12 lukaszsobek

Done :+1:

claim avatar Dec 12 '17 19:12 claim

~This seems to work for me every other time. I saw it working when testing 1hr ago; testing it again now did not break me to the right line.~

Doesn't work for me. I tested first on google.com, clicking one of the first logs in console. In the minified file that opens, prettify does highlight a line but it is not actually the one that logs the messages (but possibly just the line number that was highlighted before). Testing on BBC does not move to a new line at all.

digitarald avatar May 24 '18 23:05 digitarald

I looked into this, I won't have a chance to finish it but figured I should post my learning here.

  1. devtools/client/debugger/new/src/actions/sources/prettyPrint.js line 113, when defining selectedLocation, there is no column information, only line (which for the BBC example is line = 1, therefore it remains on line 1 when prettified).
  • the line information is lost on devtools/client/webconsole/new-console-output-wrapper.js when calling viewSourceInDebugger it does not give the column information, and so does not seem to store it.
  • I tried manually setting the options.location.column = 3487 (as in BBC example) in this place and it did not change the result.
  1. devtools/server/actors/utils/TabSources.js around line 691, getGeneratedLocation, seems to return the same location as the param originalLocation, I have yet to see this change. I believe this is close to the root of the problem.

ericawright avatar Jun 04 '18 16:06 ericawright

Thank you for the research @ericawright !

darkwing avatar Jun 04 '18 19:06 darkwing

@digitarald: are the STR from comment #0 still valid? I don't see init.js when loading bbc.com/news

Honza

janodvarko avatar Nov 21 '18 12:11 janodvarko

@janodvarko updated the example with FB

digitarald avatar Nov 21 '18 14:11 digitarald

@digitarald can you still reproduce this? If you have valid STRs I am happy to clone this into Bugzilla.

Honza

janodvarko avatar Jan 07 '20 14:01 janodvarko

This was fixed as part of m1

digitarald avatar Jan 07 '20 15:01 digitarald