From db44ad3e1832c207ba9413357cf1a3ac39cf0034 Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Wed, 11 Dec 2019 17:07:34 -0800 Subject: [PATCH] rename variable --- .../CSharpIntroduceVariableService_IntroduceLocal.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Features/CSharp/Portable/IntroduceVariable/CSharpIntroduceVariableService_IntroduceLocal.cs b/src/Features/CSharp/Portable/IntroduceVariable/CSharpIntroduceVariableService_IntroduceLocal.cs index 0becf9f13ce..f73c2511a20 100644 --- a/src/Features/CSharp/Portable/IntroduceVariable/CSharpIntroduceVariableService_IntroduceLocal.cs +++ b/src/Features/CSharp/Portable/IntroduceVariable/CSharpIntroduceVariableService_IntroduceLocal.cs @@ -198,9 +198,9 @@ private static SyntaxNode WithBlockBody(SyntaxNode node, BlockSyntax body) declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation); // If we're within a local function, our scope for the new local declaration is expanded to include the enclosing member. - var oldOutermostNode = block.GetAncestor() == null ? block : (SyntaxNode)block.GetAncestor(); + var scope = block.GetAncestor() == null ? block : (SyntaxNode)block.GetAncestor(); - var matches = FindMatches(document, expression, document, oldOutermostNode, allOccurrences, cancellationToken); + var matches = FindMatches(document, expression, document, scope, allOccurrences, cancellationToken); Debug.Assert(matches.Contains(expression)); (document, matches) = await ComplexifyParentingStatements(document, matches, cancellationToken).ConfigureAwait(false); -- GitLab