Skip to content

Prepend first statement of using block with a newline, if opening bracket is on same line as using statement#53015

Merged
CyrusNajmabadi merged 5 commits intodotnet:mainfrom
zanseb:fix-52970
Apr 29, 2021
Merged

Prepend first statement of using block with a newline, if opening bracket is on same line as using statement#53015
CyrusNajmabadi merged 5 commits intodotnet:mainfrom
zanseb:fix-52970

Conversation

@zanseb
Copy link
Contributor

@zanseb zanseb commented Apr 29, 2021

Prepend first statement of using block with a newline, if opening bracket is on same line as using statement

Fixes #52970

@ghost ghost added the Area-IDE label Apr 29, 2021
Copy link
Contributor

@sharwell sharwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall seems like a fine approach. Implementation has a small amount of specific suggested cleanup. Current tests are good, but I'd like to see two more added.

Add 2 additional unittests
Prefer 'Any' instead of 'Count == 0'
Use 'SyntaxFactory' instead of 'CSharpSyntaxFacts.Instance'
@zanseb
Copy link
Contributor Author

zanseb commented Apr 29, 2021

Thank you for your feedback @sharwell, I applied your suggestions.

@zanseb zanseb requested a review from sharwell April 29, 2021 15:27
…leUsingStatementCodeFixProvider.cs

Co-authored-by: Sam Harwell <sam@tunnelvisionlabs.com>
@CyrusNajmabadi
Copy link
Contributor

@zanseb i made a small suggestion. LMK if you want to take it. If not, i'm fine merging this in as-is.

@zanseb
Copy link
Contributor Author

zanseb commented Apr 29, 2021

@CyrusNajmabadi I was thinking about this change too. Applied your suggestion, thanks!

@CyrusNajmabadi
Copy link
Contributor

awesome. thanks for the contribution!

@CyrusNajmabadi CyrusNajmabadi merged commit 49606a9 into dotnet:main Apr 29, 2021
@ghost ghost added this to the Next milestone Apr 29, 2021
@zanseb zanseb deleted the fix-52970 branch April 29, 2021 19:30
@jinujoseph jinujoseph added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Apr 29, 2021
@RikkiGibson RikkiGibson modified the milestones: Next, 17.0.P2 Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IDE0063 does not keep line breaks and indents correctly

5 participants