Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Invert if" does not properly enclose an entire #region/#endregion #73917

Closed
bzd3y opened this issue Jun 10, 2024 · 1 comment · Fixed by #74145
Closed

"Invert if" does not properly enclose an entire #region/#endregion #73917

bzd3y opened this issue Jun 10, 2024 · 1 comment · Fixed by #74145
Labels
Area-IDE Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Milestone

Comments

@bzd3y
Copy link

bzd3y commented Jun 10, 2024

Version Used:
VS 17.10.1

Steps to Reproduce:

Add something like the following code to a program:

		public void SomeMethod()
		{
			object something = null;

			if (something == null)
			{
				return;
			}

			#region A region
			something = new object();
			#endregion
		}

And then use the "Invert if" refactor on the if statement.

Diagnostic Id:

I don't know the diagnostic id. I'm not 100% sure this refactor is part of this repository.

This also might be the case for other code block refactors.

Expected Behavior:

After the refactor the #endregion should be inside the if block.

Actual Behavior:

The refactor puts it outside the closing }.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 10, 2024
@CyrusNajmabadi CyrusNajmabadi added Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 10, 2024
@CyrusNajmabadi CyrusNajmabadi added this to the Backlog milestone Jun 10, 2024
@GiovanniBraconi
Copy link
Contributor

I'm taking a look at this 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

3 participants