Skip to content

Commit

Permalink
fix: improve reliability of ambiguousinvocationfixer
Browse files Browse the repository at this point in the history
handles (e.g.) rewrite of invocation inside method argument list
  • Loading branch information
rdavisau committed Feb 6, 2023
1 parent cbd864a commit 754cf02
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -111,8 +111,8 @@ private CSharpCompilation TryFix(CSharpCompilation compilation, List<Diagnostic>
((MemberAccessExpressionSyntax)inv.Expression).Name.WithIdentifier(
SyntaxFactory.Identifier(newIdentifier)));

var from = inv.FindNode(inv.Span);
var to = newInv.FindNode(newInv.Span);
var from = inv.FindNode(inv.Span, getInnermostNodeForTie: true);
var to = newInv.FindNode(newInv.Span, getInnermostNodeForTie: true);

tree = tree.GetRoot().ReplaceNode(from, to).SyntaxTree;
}
Expand Down

0 comments on commit 754cf02

Please sign in to comment.