-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Change value tracking to verify a parameter is used when mapping from that parameter to it's callers #76318
Conversation
src/Features/Core/Portable/ValueTracking/ValueTracker.FindReferencesProgress.cs
Outdated
Show resolved
Hide resolved
if (syntaxFacts.IsArgument(descendantNode)) | ||
{ | ||
// Ensure this is an argument to the requested invocation | ||
if (invocationSyntax != descendantNode.FirstAncestorOrSelf<SyntaxNode>(syntaxFacts.IsInvocationExpression)) |
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.
this isn't a great way to do things. consider using ISyntaxFacts which will letyou decompose things in a language agnostic fashino, while still being:
- somewhat strongly typed.
- ensuring you don't have code that is waslking down infinitely deep and all the way back up again.
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.
another approach is to simply use IOp to get the IInvocationOp for your invocation. Then find the IArg corresponding to your parameter. And then just see if it is .Implicit or not.
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.
Ah, I was making this too complicated. As you mentioned IInvocationOp already has what I need.
Change the value tracking code such that parameters only add callers that specify that parameter as an argument.
Fixes #66771