Closed Bug 1014634 Opened 11 years ago Closed 11 years ago

Make Pretty Print string normalization configurable

Categories

(DevTools Graveyard :: Scratchpad, defect)

32 Branch
defect
Not set
normal

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.
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 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)
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
(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.
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).
Attachment #8427093 - Flags: feedback?(nfitzgerald)
Product: Firefox → DevTools
Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: