How to set up formatting to align multi-line method chains

I'd swear this was working at some point, but I seem to have tweaked my C# formatting settings once too many times, and I can't figure out how to get it back.

I just want a multi-line method chain to line up the dots. Currently, all I can do is:

 Dictionary<string, List<string>> dict = items.Select(i => i.Property)
     .Where(c => c.State == "Foo")
     .ToDictionary(t => t.ItemId);


When what I'd like is:

 Dictionary<string, List<string>> dict = items.Select(i => i.Property)
                                              .Where(c => c.State == "Foo")
                                              .ToDictionary(t => t.ItemId);



Any advice on how to set this up would be appreciated.

Note: this is using 5.1.2 EAP Build 1758

2 comments
Comment actions Permalink

Hello Rob,

Actually there's no code style option to control the formatting of chained
method calls. There's an issue in our tracker: http://youtrack.jetbrains.net/issue/RSRP-88220
and you're welcome to monitor its status. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I'd swear this was working at some point, but I seem to have tweaked
my C# formatting settings once too many times, and I can't figure out
how to get it back.

I just want a multi-line method chain to line up the dots. Currently,
all I can do is:

 List> dict = items.Select(i => i.Property)
> .Where(c => c.State == "Foo")
> .ToDictionary(t => t.ItemId);]]>

When what I'd like is:

 List> dict = items.Select(i => i.Property)
> .Where(c => c.State ==
> "Foo")
> .ToDictionary(t =>
> t.ItemId);]]>

Any advice on how to set this up would be appreciated.

---
Original message URL:
http://devnet.jetbrains.net/message/5279400#5279400



0
Comment actions Permalink

Maybe you had something similar to below?
E.g. with default settings "Call arguments" and "Expression" checked (tab size 4):




screen1.png

screen2.png
With  "Expression" unchecked:

screen4.png

With both "Expression" and "Call arguments" unchecked:


screen6.png

0

Please sign in to leave a comment.