Formatting options for QBSelect

In developer we can format our code using the Source → Format menu (or a keycode combination). The way the code is formatted can be controlled using various options in the Developer settings in the Javascript → Formatter section. I have set these so that when I format my code I get pretty much the layout I want but I cannot seem to control the way that a QBSelect is formatted.

I have the following code before the format:

qMedias.where
	.add(qMedias.columns.tenant_name.eq(recTenant.tenant_name))
	.add(qMedias.columns.path.eq(path))
	.add(qMedias.columns.name.eq(docName))
	.add(qMedias.or
		.add(qMedias.columns.sha256.eq(sha256))
		.add(qMedias.columns.sha256.isNull));

I would very much like it to stay that way as I feel it makes the code more readable but when I format the code I end up with the whole statement on one line.

qMedias.where.add(qMedias.columns.tenant_name.eq(recTenant.tenant_name)).add(qMedias.columns.path.eq(path)).add(qMedias.columns.name.eq(docName)).add(qMedias.or.add(qMedias.columns.sha256.eq(sha256)).add(qMedias.columns.sha256.isNull));

Are there any settings I can change that will allow the statement chaining to remain on separate lines?

TIA
Steve

+1

+1

I have added a feature request for this here

You can add // to the end and start on a new line.
Then the formatter will skip the qbSelect

var qVehicles = datasources.db.autoflex_cloud.vehicles.createSelect();
qVehicles.where.add(//
qVehicles.and.add(//
qVehicles.or.add(//
qVehicles.columns.is_archived.isNull)//
.add(qVehicles.columns.is_archived.eq(0)))//
.add(qVehicles.columns.is_company_stock.eq(1)))//
.add(qVehicles.joins.vehicles_to_purchase_sales.columns.order_line_vehicle_sale_id.eq(null)//
);

Great tip!

Thanks