-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Update find-refs to find references to Dispose in a using-statement #76221
Conversation
@@ -90,7 +90,7 @@ private static SyntaxTreeIndex CreateIndex( | |||
|
|||
containsForEachStatement = containsForEachStatement || syntaxFacts.IsForEachStatement(node); | |||
containsLockStatement = containsLockStatement || syntaxFacts.IsLockStatement(node); | |||
containsUsingStatement = containsUsingStatement || syntaxFacts.IsUsingStatement(node); | |||
containsUsingStatement = containsUsingStatement || syntaxFacts.IsUsingStatement(node) || syntaxFacts.IsUsingLocalDeclarationStatement(node); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify for me, this is tracking both "using namespace" and "using var foo = IDisposable" statements, right?
Yes.
Other than the name being the same, why are they grouped together?
Because this is for FindRefs, which only cares about tthis info just to say "should i look for Dispose references here?". And for FindRefs, it doesn't care about which of the two cases it is.
I could do this as two different bools, but the consumption side would then have to check for both. So i just collapse here to one bool since htat's all we need.
Fixes #34107