Closed
Bug 975477
Opened 10 years ago
Closed 10 years ago
Scratchpad [ Pretty Print ] should not move end of line comments to next line
Categories
(DevTools Graveyard :: Scratchpad, defect, P4)
Tracking
(Not tracked)
VERIFIED
FIXED
Firefox 32
People
(Reporter: anaran, Assigned: anaran)
References
Details
Attachments
(2 files, 2 obsolete files)
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:30.0) Gecko/20100101 Firefox/30.0 (Beta/Release) Build ID: 20140220030202 Steps to reproduce: Please use attached test case and see how end of line comments are moved onto next line. Not only does it put the comments out of context, it even breaks tools using NON-NLS comments markers for i18n. Expected results: End of line comment should just be left there by [ Pretty Print ].
Assignee | ||
Comment 1•10 years ago
|
||
Just click [ Pretty Print ] and see.
Updated•10 years ago
|
Component: Untriaged → Developer Tools: Scratchpad
Updated•10 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•10 years ago
|
Summary: Scratchpad [ Pretty Print ] breaks NON-NLS markers → Scratchpad [ Pretty Print ] moves end of line comments to next line
Updated•10 years ago
|
OS: Windows XP → All
Priority: -- → P3
Hardware: x86 → All
Comment 2•10 years ago
|
||
See https://github.com/mozilla/pretty-fast#non-goals This doesn't break the semantics of the code and in the 99.99% case makes it more readable.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
Assignee | ||
Comment 3•10 years ago
|
||
I hope I can convince you to really fix this. js-beautify had this issue and they fixed it: https://github.com/einars/js-beautify/issues/242 I've never seen a comment documenting the previous line. Once the confusion would wane that would still be a pretty irritating novelty. (I just checked firefox sources in the browser toolbox and comments always come befor the line or block they comment.) Admittedly firefox does not seem to use EOL comments, but shouldn't scratchpad play nice with existing, reasonable source code as well?
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Assignee | ||
Comment 5•10 years ago
|
||
OK, I'll bite. This path contains changes to git.mozilla.org/gecko-dev/toolkit/devtools/pretty-fast/ which I realize lives upstream at https://github.com/mozilla/pretty-fast I can separate this out when my overall approach seems sound. I have also sneaked in a change to fix switch statement indentation to agree with what codemirror does and the mozilla coding standard at https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Control_Structures says. As a consequence I broke the xpcshell tests, but in a good way. Just let me know how to proceed. 0:10.19 TEST-UNEXPECTED-FAIL | c:/tmp/git.mozilla.org/gecko-dev/firefox-static/_tests/xpcshell/toolkit/devtools/pretty-fast/tests/unit/test.js | Error: Expected: switch (x) { case a: foo(); break; default: bar() } Got: switch (x) { case a: foo(); break; default: bar() } at c:/tmp/git.mozilla.org/gecko-dev/firefox-static/_tests/xpcshell/toolkit/devtools/pretty-fast/tests/unit/test.js:499 ...
Attachment #8428295 -
Flags: feedback?(nfitzgerald)
Assignee | ||
Updated•10 years ago
|
Summary: Scratchpad [ Pretty Print ] moves end of line comments to next line → Scratchpad [ Pretty Print ] should not move end of line comments to next line
Assignee | ||
Comment 6•10 years ago
|
||
This patch now does what the bug says. I have moved the switch statement indentation changes to Bug 1018586 Comment 1.
Attachment #8428295 -
Attachment is obsolete: true
Attachment #8428295 -
Flags: feedback?(nfitzgerald)
Attachment #8432126 -
Flags: review?(nfitzgerald)
Comment 7•10 years ago
|
||
Comment on attachment 8432126 [details] [diff] [review] 0001-Bug-975477-Scratchpad-Pretty-Print-should-not-move-e.patch Review of attachment 8432126 [details] [diff] [review]: ----------------------------------------------------------------- Needs a test and see also the comment here about patch formatting and just submitting PRs to upstream: https://bugzilla.mozilla.org/show_bug.cgi?id=1018586#c3
Attachment #8432126 -
Flags: review?(nfitzgerald)
Assignee | ||
Comment 8•10 years ago
|
||
Attachment #8432126 -
Attachment is obsolete: true
Attachment #8432770 -
Flags: review?(nfitzgerald)
Comment 9•10 years ago
|
||
Comment on attachment 8432770 [details] [review] Upstream pull request, with new test coveralge Created bug 1020587 to update pretty-fast in the tree which will fix this.
Attachment #8432770 -
Flags: review?(nfitzgerald)
Comment 10•10 years ago
|
||
Resolved as part of https://hg.mozilla.org/mozilla-central/rev/e157171a4df1
Status: REOPENED → RESOLVED
Closed: 10 years ago → 10 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
Assignee: nobody → nfitzgerald
Target Milestone: --- → Firefox 32
Updated•10 years ago
|
Assignee: nfitzgerald → adrian
Updated•10 years ago
|
QA Whiteboard: [good first verify]
Comment 11•10 years ago
|
||
Reproduced the issue on 2014-02-21 Nightly build, verified as fixed on Firefox 32 Beta 2 (buildID: 20140728123914) under Windows 7 64bit, Mac OS X 10.9 and Ubuntu 64bit.
Status: RESOLVED → VERIFIED
QA Whiteboard: [good first verify] → [good first verify] [bugday-20140730]
Updated•6 years ago
|
Product: Firefox → DevTools
Updated•4 years ago
|
Product: DevTools → DevTools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•