Closed
Bug 1014634
Opened 11 years ago
Closed 11 years ago
Make Pretty Print string normalization configurable
Categories
(DevTools Graveyard :: Scratchpad, defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: anaran, Unassigned)
Details
Attachments
(1 file)
Currently strings are normalized to single-quote from.
Various Mozilla coding standards recommend double-quote:
https://github.com/mozilla/addon-sdk/wiki/Coding-style-guide
https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style
These don't mention a preference but mochitest largely uses double-quote as well:
https://wiki.mozilla.org/DevTools/mochitests_coding_standards
https://wiki.mozilla.org/DevTools/CodingStandards
Since the current default for scratchpad is single-quote it might be best to make this configurable, just like tabsize.
I already have an experimental implemetation basically working and would like to take this bug.
| Reporter | ||
Comment 1•11 years ago
|
||
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.
Also, my addition of
pref("devtools.editor.quotechar", "'");
is currently used without error checking.
I would like to know how I should best address invalid pref values, like " ".
Comment 2•11 years ago
|
||
Comment on attachment 8427093 [details] [diff] [review]
0001-Bug-1014634-Make-Pretty-Print-string-normalization-c.patch
Nick is the person to ask.
Attachment #8427093 -
Flags: feedback?(nfitzgerald)
Comment 3•11 years ago
|
||
I appreciate the work you did to get this to work, however I don't believe that the value gained is worth the amount we complicate the code to implement the feature, especially when configuration of pretty printed code is a non-goal:
https://github.com/mozilla/pretty-fast#non-goals
> * Extreme configurability of types of indentation, where curly braces go, etc.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
| Reporter | ||
Comment 4•11 years ago
|
||
(In reply to Nick Fitzgerald [:fitzgen] from comment #3)
> I appreciate the work you did to get this to work, however I don't believe
> that the value gained is worth the amount we complicate the code to
> implement the feature, especially when configuration of pretty printed code
> is a non-goal:
>
> https://github.com/mozilla/pretty-fast#non-goals
>
> > * Extreme configurability of types of indentation, where curly braces go, etc.
Yep, I saw that section.
However, shouldn't Scratchpad then be compliant with
https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style
and the vast majority of mozilla sources and use double-quote instead of single-quote for strings?
Right now Pretty Print cannot be used at all when working on gecko-dev sources.
Comment 5•11 years ago
|
||
The goal of the pretty print button is to make minified code somewhat readable and debuggable; it isn't meant as a JS formatter for gecko/firefox development (especially since it only supports ES5, not ES6 or spidermonkey's non-standard extensions).
Updated•11 years ago
|
Attachment #8427093 -
Flags: feedback?(nfitzgerald)
Updated•7 years ago
|
Product: Firefox → DevTools
Updated•6 years ago
|
Product: DevTools → DevTools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•