[1177] Lambda braces - strange behaviour?

Starting with this ( | = insertion point ):


         iAddBoard.ItemClick += (sender, args) => |
         ribbon.ApplicationButtonDoubleClick += (sender, args) => Close();


Type { and you get the following:

         iAddBoard.ItemClick += (sender, args) => {
         ribbon.ApplicationButtonDoubleClick += (sender, args) => Close()};


Is this as designed?  the second line already existed and I want the line to come out as:

         iAddBoard.ItemClick += (sender, args) => {}
         ribbon.ApplicationButtonDoubleClick += (sender, args) => Close();


Thanks

Sean


2 comments

This behavior was right for C# 2.0 and earlier... We haven't updated brace
auto-insertion algorithm since that, and definitely we should.

--
Eugene Pasynkov
ReSharper Technical Lead
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


"sean kearon" <no_reply@jetbrains.com> wrote in message
news:22905330.11221234659384952.JavaMail.clearspace@app4.labs.intellij.net...

Starting with this ( | = insertion point ):

>
>

iAddBoard.ItemClick += (sender, args) => |
ribbon.ApplicationButtonDoubleClick += (sender, args) => Close();

>

Type { and you get the following:

>

iAddBoard.ItemClick += (sender, args) => {
ribbon.ApplicationButtonDoubleClick += (sender, args) => Close()};

>

Is this as designed? the second line already existed and I want the line
to come out as:

>

iAddBoard.ItemClick += (sender, args) => {}
ribbon.ApplicationButtonDoubleClick += (sender, args) => Close();

>

Thanks

>

Sean

>
>
>

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



0

Yeah, it's certainly worked well for me up until now.  What I can't remember happening before though is that the end brace is inserted on the second line when there is a balnk line immediately below the current line.  I find this confusing as the brace is simply appended to the line and in force bracing layout is not put into play.  Maybe it would help to see what had happened if the layout was changed after bracing was applied.

0

Please sign in to leave a comment.