Skip to content

Commit

Permalink
Merge pull request #51889 from CyrusNajmabadi/underlingVariables
Browse files Browse the repository at this point in the history
Add ability to underline variables in the editor that are reassigned.
  • Loading branch information
CyrusNajmabadi authored May 25, 2021
2 parents a933a4a + a62de54 commit f04d51c
Show file tree
Hide file tree
Showing 91 changed files with 2,417 additions and 193 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private static bool CanReplaceAnonymousWithLocalFunction(
if (identifierName.Identifier.ValueText == local.Name &&
local.Equals(semanticModel.GetSymbolInfo(identifierName, cancellationToken).GetAnySymbol()))
{
if (identifierName.IsWrittenTo())
if (identifierName.IsWrittenTo(semanticModel, cancellationToken))
{
// Can't change this to a local function if it is assigned to.
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private void SyntaxNodeAction(SyntaxNodeAnalysisContext syntaxContext)
// Check if this is a 'write' to the asOperand.
if (identifierName.Identifier.ValueText == asOperand?.Name &&
asOperand.Equals(semanticModel.GetSymbolInfo(identifierName, cancellationToken).Symbol) &&
identifierName.IsWrittenTo())
identifierName.IsWrittenTo(semanticModel, cancellationToken))
{
return;
}
Expand Down
Loading

0 comments on commit f04d51c

Please sign in to comment.