History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-36176
Type: Bug Bug
Status: Open Open
Priority: Normal Normal
Assignee: Eugene Pasynkov
Reporter: Michael
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
ReSharper

Align multiline constructs problem (call arguments, expression)

Created: 22 Feb 07 18:26   Updated: 24 Mar 07 00:20
Component/s: Code Cleanup
Fix Version/s: None
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 337


 Description  « Hide
It seems that the Align Call Arguments options have no effect on code formatting. Instead, their alignment is controlled by the setting of Align Expression.

This leads to a very serious formatting problem for me:
Supppose I have the method call spanning multiple lines because of a bunch of long parameters. I would it expect to be formatted like this
(continous line indent multiplier = 2, indent size = 2)
MyType myType = someObject.GetMyType.MyGetMethod (
parameter1,
parameter3,
parameter3);

But because the method parameters are (or seem to be) formatted by to the Align Expression setting instead of Align Call Arguments, I get the following result.
MyType myType = someObject.GetMyType.MyGetMethod (
parameter1,
parameter3,
parameter3);

And if I switch off Align Expression, the method call arguments are aligned properly (see example 1), but my multiline string, numeric or boolean expressions go crazy:
string text = "part 1"
+ "part 2"
+ "part 3"
+ "part 4";

On a side note: May I suggest to alter the sample for Align Call Arguments:
Right now it shows
foo (
firstParameter,
seconParameter);
and since the method name starts on the first column, you cannot tell where the alignment is relative to.
I would suggest:
myVeryVeryVeryVeryVeryLongVariableName.Foo (
firstParameter,
secondParameter);
(or something like this).



 All   Comments   Work Log   Change History      Sort Order:
Michael - 22 Feb 07 18:31
Looks like the editor killed my identation in the code samples (I've reworked them with dots instead of spaces):

Example 1:
MyType myType = someObject.GetMyType.MyGetMethod (
....parameter1,
....parameter3,
....parameter3);

Example 2:
MyType myType = someObject.GetMyType.MyGetMethod (
................................................................................parameter1,
................................................................................parameter3,
................................................................................parameter3);

Example 3:
string text = "part 1"
....+ "part 2"
........+ "part 3"
............+ "part 4";

Example 4:
foo (
....firstParameter,
....seconParameter);

Example 5:
myVeryVeryVeryVeryVeryLongVariableName.Foo (
....firstParameter,
....secondParameter);


Harald-René Flasch - 22 Feb 07 18:31
Maybe screen-shots will be helpful to see what's happening.

Michael - 24 Mar 07 00:20
Looks like it is fixed in Build 402.