| Priority |
Normal |
| Type | Usability Problem |
| State | Submitted |
| Assignee | Andrew Koryavchenko |
| Subsystem | No subsystem |
| Affected versions |
No affected versions
|
| Fix for |
No fix versions
|
|
|
mockCrypto.Expect(c => c.Hash("authenticationHashSalt", "ignoring arguments")).IgnoreArguments().Return("hashed");
mockCrypto.Expect(c => c.Hash("authenticationHashSalt", "ignoring arguments"))
.IgnoreArguments()
.Return("hashed");
Orders = accountContext.Orders.OrderBy( o => o.Description ).Select(
o => viewModelFactory.Create<SearchOrderViewModel>( o ) ).ToArray();
ReSharper needs an option to order each function ind a function calling pipe to be ordered on a single line. Example:
Orders = accountContext.Orders.OrderBy( o => o.Description )
.Select(o => viewModelFactory.Create<SearchOrderViewModel>( o ) )
.ToArray();
Same problem, I'm getting which is pretty much unreadable, while an option to add a line break in a function call chain could give
Enforcing a line break starting at, say, the second method call would probably be quite sufficient for fluent interfaces, though it would also enforce it for 'standard' code using smaller call chains.
Personally, I wouldn't mind that since it would help to highlight problems (excessive violations of the law of demeter, need to introduce variables to make the code more readable, ...)
Alternatively, it could be a 'Chop always' extension to the current line wrapping option, in the same spirit as the options for formal parameters and invocation arguments. If the line is too long, it chops it before each '.'
Enabling 'Keep existing line breaks' is a workaround to do this manually, but it also makes regular reformatting much more tedious.
Also, #99007 does duplicate #88220 in one particular case: the 'chop always/chop if long' option. If the method chain is chopped starting at the first period, all calls would be aligned on the same column:
public int After { get { return _visitors .Where(v => v.RowsWritten != 0) .Select(v => v.RowsWritten) .FirstOrDefault(); } }Not exactly the suggested formatting in #99007, but close. Additionally, being able to align under the initial object in the chain + 1 tab indent would give:public int After { →get →{ →→return _visitors →→- - - - - - - →.Where(v => v.RowsWritten != 0) →→- - - - - - - →.Select(v => v.RowsWritten) →→- - - - - - - →.FirstOrDefault(); →} }This seems to be the real difference between those issues.