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

Visual Studio 16.10 Updates #59

Merged
merged 5 commits into from
Aug 10, 2021
Merged

Visual Studio 16.10 Updates #59

merged 5 commits into from
Aug 10, 2021

Conversation

RehanSaeed
Copy link
Owner

Fixes #48.

dotnet_style_parentheses_in_other_operators

We got some better documentation from .NET about this setting which makes it clear that we should change our configuration from a suggestion of using always_for_clarity to a warning to use never_if_unnecessary:

// dotnet_style_parentheses_in_other_operators = always_for_clarity
var v = (a.b).Length;

// dotnet_style_parentheses_in_other_operators = never_if_unnecessary
var v = a.b.Length;

The second example seems more desirable.

dotnet_style_operator_placement_when_wrapping

Realized that this setting was missing the error level, so set it to warning.

csharp_style_prefer_null_check_over_type_check

Enabled this setting to prefer is not null over is object. Set to warning level. See dotnet/roslyn#55005.

// csharp_style_prefer_null_check_over_type_check = false
foo is object
// csharp_style_prefer_null_check_over_type_check = true
foo is not null

dotnet_style_namespace_match_folder

Enabled this setting so that namespaces must match folders. Set at suggestion level as sometimes devs want to also use logical folders to group content instead of representing hard folders. This is particularly useful when a namespace contains a large amount of content. See dotnet/roslyn#49990.

I've also polled the community for their thoughts on the defaults here https://twitter.com/RehanSaeedUK/status/1424724592082493440.

@RehanSaeed RehanSaeed added enhancement Issues describing an enhancement or pull requests adding an enhancement. major Pull requests requiring a major version update according to semantic versioning. labels Aug 9, 2021
@RehanSaeed RehanSaeed requested a review from henrygab August 9, 2021 13:50
@RehanSaeed RehanSaeed merged commit b0bfc05 into main Aug 10, 2021
@RehanSaeed RehanSaeed deleted the vs-16-10-updates branch August 10, 2021 13:15
@T-0pel
Copy link

T-0pel commented Aug 17, 2021

Hi, I have tested out the dotnet_style_namespace_match_folder setting and it seems to run into issues with files that are placed directly in the project. It seems to want to add a '.' at the end of the namespace:

image

@RehanSaeed
Copy link
Owner Author

Yes, it seems there is an open issue about this in the roslyn repo. I expect it to get fixed very soon (probably with the .NET 6 release). Since this is set to suggestion level, I don't plan to make changes to the .editorconfig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues describing an enhancement or pull requests adding an enhancement. major Pull requests requiring a major version update according to semantic versioning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Settings in VS 16.10
3 participants