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.
It is fairly common to see frameworks which want you to pass a very small javascript "object" as a parameter - witness node.js's http.request or node.js's mongodb driver. It is annoying that reformat code breaks the formatting of small objects across lines - so this: collection.update (query, data, {safe : true}, function (err, data) { ... } gets reformatted into much-less-readable: collection.update (query, data, { safe : true }, function (err, data) { ... } A simple heuristic which would get this right most of the time would be: - If the hash has 1-2 key/value pairs - If it is already on a single line leave it alone, otherwise reformat it.
I think there could be an option for it. Some combobox with items 1 pair, 2 pars, 3 pairs, never, always.
Okay, some sort of threshold number of items before a single-line hash is altered. But what will the default be?
(In reply to comment #2) > Okay, some sort of threshold number of items before a single-line hash is > altered. > > But what will the default be? Why "Object Properties: Never" is not enough?