Skip to content

When inverting If with code only in Else section, The code moves to the primary area and is left in the else #43224

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


I have VB.NET code that looks like:

If SomeValue = AnotherValue Then
Else
    DoStuff()
End If

When I select the Invert If code fix I end up with:

If SomeValue <> AnotherValue Then
    DoStuff()
Else
    DoStuff()
End If

I am in VS 2019 version 16.5.2


Original Comments

Visual Studio Feedback System on 4/2/2020, 08:05 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

Metadata

Metadata

Assignees

Labels

Area-IDEBugDeveloper CommunityThe issue was originally reported on https://developercommunity.visualstudio.comIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringshelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions