I suggest you ...

convert single line if statement to multi line if statement

This is a minor but irritating issue.

Suppose that I have the following line of code:

If someValue = True Then DoSomething()

and I need to change it to:

If someValue Then
DoSomething()
DoSomethingElse()
End If

Then I insert the cursor after the 'Then' and press 'enter' resulting in:

If someValue = True Then
<Cursor Here>
End IF
DoSomething()

I think that it would generally be more useful if the editor could do this instead:

If someValue = True Then
DoSomething()
<Cursor Here>
End IF

57 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Robert SmithRobert Smith shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    completed  ·  Visual Studio teamAdminVisual Studio team (Product Team, Microsoft) responded  · 

    Hey everyone,

    If you hadn’t heard already last week at BUILD we announced the PUBLIC release of a Preview of the next version of the Visual Basic language and code editing experience powered by “Roslyn”. You can download this preview and install it on top of Visual Studio 2013 today!

    I’m thrilled to say that we’ve taken this suggestion to heart and in the preview you can see for yourself.

    Download the End User Preview @ http://msdn.microsoft.com/en-US/vstudio/roslyn

    I encourage you all to download it, try it out, and send us your feedback.

    Regards,

    Anthony D. Green, Program Manager, Visual Basic & C# Languages Team

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • AnonymousAnonymous commented  ·   ·  Flag as inappropriate

        I find this an annoyance as well. When updating code, while the single line IF was efficient and all that was needed originally, sometimes it needs to be made more complex, and thus go from a inline IF to a normal IF.

      Feedback and Knowledge Base