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

Respect editorconfig var preference in CA1854 #6023

Merged
merged 4 commits into from
Jun 10, 2022

Conversation

Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Jun 9, 2022

Part of #6022

@codecov
Copy link

codecov bot commented Jun 9, 2022

Codecov Report

Merging #6023 (008f8d0) into main (114d5f2) will increase coverage by 0.00%.
The diff coverage is 98.24%.

@@           Coverage Diff           @@
##             main    #6023   +/-   ##
=======================================
  Coverage   96.03%   96.03%           
=======================================
  Files        1338     1338           
  Lines      307108   307164   +56     
  Branches     9785     9787    +2     
=======================================
+ Hits       294917   294974   +57     
+ Misses       9814     9812    -2     
- Partials     2377     2378    +1     

var model = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
if (model.GetTypeInfo(dictionaryAccess).Type is not { } type)
{
return;
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if the type is always available, probably should use var if it is not

@buyaa-n
Copy link
Member

buyaa-n commented Jun 9, 2022

Thanks @Youssef1313, looks good to me except it is not covered the variable name duplication part of #6022, could you cover that with this PR? We can still merge this PR without that and leave the issue open for that part

@Youssef1313
Copy link
Member Author

Youssef1313 commented Jun 10, 2022

I'll take a look at the duplication issue later. The fix will likely be using LookupSymbols iteratively (value, value1, value2, value3, ...) until we find a good name.

Copy link
Member

@buyaa-n buyaa-n left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @Youssef1313!

@buyaa-n buyaa-n merged commit 0e7f40d into dotnet:main Jun 10, 2022
@github-actions github-actions bot added this to the vNext milestone Jun 10, 2022
@Youssef1313 Youssef1313 deleted the var-user-preference branch June 11, 2022 02:16
@jmarolf jmarolf modified the milestones: vNext, .NET 7.x Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants