This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 233631 - Have a category "Quotes" under Formatting options
Summary: Have a category "Quotes" under Formatting options
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.3.1
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-30 08:09 UTC by terje7601
Modified: 2013-08-05 07:27 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description terje7601 2013-07-30 08:09:31 UTC
In several languages (PHP, Javascript, HTML, XML, ...) it's possible to use both single and double quotes for string literals (attributes in the case of HTML/XML).

So it would be nice to have a formatting option to set the desired quoting style. Currently I'm working on a project where quoting is inconsistent & this feature would allow me to simply format the whole project to make all quoting consistent.

Ideally, there would also be an option to specify what to do in case the string literal contains the desired quotes:
* leave it as is, so that there's no need to escape
* force the quoting style & escape embedded quotes
There could also be a "Threshold" option to decide when to choose what. For example: if the treshold = 3, this would mean: if there are less than 3 quotes that would need escaping, force the quoting style & escape as necessary. Else if there are at least 3 such quotes, leave it as is so as to avoid having to escape all the quotes.
Comment 1 Jiri Prox 2013-08-05 07:27:36 UTC
This is language specific - reassigning to PHP since it is first in the list