Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Fix 4690 [PrettyPrint] enable “Jump to Generated Location"#4698

Merged
bomsy merged 6 commits into
firefox-devtools:masterfrom
jainsneha23:bug-4690
Nov 18, 2017
Merged

Fix 4690 [PrettyPrint] enable “Jump to Generated Location"#4698
bomsy merged 6 commits into
firefox-devtools:masterfrom
jainsneha23:bug-4690

Conversation

@jainsneha23

Copy link
Copy Markdown
Contributor

Associated Issue: #4690

Summary of Changes

  • Enable "Jump to Generated Location" for pretty printed files
  • Enable "Jump to Original Location", if the file's original source is opened in a tab

Test Plan

  • Open a tab, "Jump to Original Location" is disabled
  • Click on pretty print in the footer
  • "Jump to Original Location" is enabled
  • Go to the pretty printed tab
  • "Jump to Generated Location" is enabled

Screenshots

screen shot 2017-11-15 at 4 48 14 pm

screen shot 2017-11-15 at 4 48 29 pm

screen shot 2017-11-15 at 4 48 37 pm

screen shot 2017-11-15 at 4 48 54 pm

screen shot 2017-11-15 at 4 49 06 pm

Comment thread src/components/Editor/EditorMenu.js Outdated
const jumpLabel = {
accesskey: L10N.getStr("editor.jumpToMappedLocation1.accesskey"),
disabled: isGeneratedId && !hasSourceMap,
disabled: isGenerated && !hasSourceMap && !hasPrettyPrint,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we also check isPrettyPrinted since we have it anyways
i.e disabled: isGenerated && !hasSourceMap && (!hasPrettyPrint || !isPrettyPrinted),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, i like naming these bools:

isPretty = hasPrettyPrint || !isPrettyPrinted
noMap = isGenerated && !hasSourceMap

or something like that. noMap is clearly a bad name

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i changed the code to include both comments. please check

@bomsy bomsy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bomsy bomsy merged commit e6f9968 into firefox-devtools:master Nov 18, 2017
@jainsneha23 jainsneha23 deleted the bug-4690 branch July 17, 2018 09:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants