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

Port 'Top Level Statements' code style PR to 17.3 #60426

Merged
merged 72 commits into from
Mar 29, 2022

Conversation

CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented Mar 28, 2022

Provides a user facing option in VS to control preferences around top-level-statements. Looks like:

image

or

image

When set to prefer 'Program.Main' style, if a new project is created using a template that uses top-level-statements, then we will convert that template to use the traditional style like so:

image

This preference is also exposed through our standard analyzer/fixer/refactoring system so it can be used to change code after a project has already been created. For example an existing Program.Main program can be converted to a top-level-statement program (if viable):

image

Likewise, all top-level-statement programs can be converted back to a traditional Program.Main program:

image

@CyrusNajmabadi
Copy link
Member Author

Already signed off in: #60383

@@ -171,7 +171,10 @@ internal static class IDEDiagnosticIds

public const string RemoveUnnecessaryLambdaExpressionDiagnosticId = "IDE0200";

public const string ForEachCastDiagnosticId = "IDE0210";
Copy link
Member Author

Choose a reason for hiding this comment

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

intentionally taking this ID. if we back port this dev17.2, we want to keep these IDEs the same there.

@@ -396,30 +396,21 @@ public void CSharp_VerifyIDEDiagnosticSeveritiesAreConfigurable()
# IDE0090
dotnet_diagnostic.IDE0090.severity = %value%

# IDE0110
dotnet_diagnostic.IDE0110.severity = %value%

Copy link
Member Author

Choose a reason for hiding this comment

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

sorting, how does it work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants