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 202556 - Unexpected formatting for multiline statements
Summary: Unexpected formatting for multiline statements
Status: RESOLVED DUPLICATE of bug 196368
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal with 3 votes (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
: 208168 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-23 11:51 UTC by aengel
Modified: 2013-06-19 11:37 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of the editor settings (85.88 KB, image/jpeg)
2011-09-23 12:41 UTC, aengel
Details
Export of my Editor > Other settings (21.79 KB, application/octet-stream)
2011-09-23 12:50 UTC, aengel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aengel 2011-09-23 11:51:36 UTC
When using the formatter on a codesnippet with a multiline notation it formats in an unexpected way. It looks like the continuation indetation miscounts it's depth.

For example, this source code:

$oTest->methodCall(
	'parameter1', 
	array(
		'arrayKey1' => $sValue1,
		'arrayKey2' => $sValue2,
		'arrayKey3' => $sValue3
	)
);

Will be formatted (with our current settings) into:

$oTest->methodCall(
	'parameter1', array(
	'arrayKey1' => $sValue1,
	'arrayKey2' => $sValue2,
	'arrayKey3' => $sValue3
	)
);

This way it looks like the methodCall has 4 parameters.
We can't seem to adjust the formatter settings to keep the notation of the first example intact.
Comment 1 Petr Pisl 2011-09-23 12:35:02 UTC
You are right, this case is formatted wrong. I have different results (wrong as well). How do you have set up the continuation property?
Comment 2 aengel 2011-09-23 12:41:58 UTC
Created attachment 111096 [details]
Screenshot of the editor settings
Comment 3 aengel 2011-09-23 12:50:10 UTC
Created attachment 111097 [details]
Export of my Editor > Other settings
Comment 4 Petr Pisl 2011-09-23 12:53:14 UTC
Thanks.
Comment 5 aengel 2011-09-23 12:55:08 UTC
(In reply to comment #4)
> Thanks.

Thank you, for responding this fast, again.
Thumbs up. :)
Comment 6 Ondrej Brejla 2012-11-16 12:39:35 UTC
*** Bug 208168 has been marked as a duplicate of this bug. ***
Comment 7 Ondrej Brejla 2012-11-29 09:57:56 UTC
It has 2 parts. 

First is yours :) You have set "Formatting -> PHP-> Wrapping -> Method Call Arguments" to "Always". Then you will have every argument on a single line. Otherwise, when "Never" is selected, then it will never be wrapped and it will be in one line ;)

And the second part is mine. I have to fix that array indentation ;)
Comment 8 Ondrej Brejla 2013-06-19 11:37:55 UTC
Duplicate issue.

*** This bug has been marked as a duplicate of bug 196368 ***