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

pattern vs. prefer naming #28285

Closed
MisinformedDNA opened this issue Feb 17, 2022 · 5 comments
Closed

pattern vs. prefer naming #28285

MisinformedDNA opened this issue Feb 17, 2022 · 5 comments

Comments

@MisinformedDNA
Copy link
Contributor

The documentation says the rule name is csharp_style_pattern_local_over_anonymous_function and that's what works for me in VS 2022 17.0.4, but the Roslyn code base changed the name to csharp_style_prefer_local_over_anonymous_function. When is the latter used over the former?

@CyrusNajmabadi


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@CyrusNajmabadi
Copy link
Member

The documentation says the rule name is csharp_style_pattern_local_over_anonymous_function and that's what works for me

that name was simply a mistake (due to a copy/paste error). It was always supposed to be be 'prefer_X_over_Y' as that is what we use elsewhere. The 'pattern' part was copied from another config key errantly.

@MisinformedDNA
Copy link
Contributor Author

Yes, it's a good fix, but 'pattern' is still recognized in VS, but 'prefer' is not. Is a future version of VS needed for 'prefer' to be recognized?

@CyrusNajmabadi
Copy link
Member

You'll need 17.1 to pick this up. Thanks!

@dotnet-bot dotnet-bot added ⌚ Not Triaged Not triaged and removed ⌚ Not Triaged Not triaged labels Feb 18, 2022
@cremor
Copy link

cremor commented Mar 10, 2022

@MisinformedDNA Why did you close this issue? The documentation was not updated for the new rule name.

@gewarren
Copy link
Contributor

This was fixed by #30059.

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

No branches or pull requests

6 participants