Skip to content

Commit

Permalink
Merge pull request #61379 from CyrusNajmabadi/renameSimplification
Browse files Browse the repository at this point in the history
Minor simplification to rename code
  • Loading branch information
CyrusNajmabadi authored May 18, 2022
2 parents 87fe251 + c591fcc commit f7b944d
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,12 @@ public void Commit(CancellationToken cancellationToken)
{
_stateMachine.ThreadingContext.ThrowIfNotOnUIThread();

var clearTrackingSession = ApplyChangesToWorkspace(cancellationToken);
ApplyChangesToWorkspace(cancellationToken);

// Clear the state machine so that future updates to the same token work,
// and any text changes caused by this update are not interpreted as
// potential renames
if (clearTrackingSession)
{
_stateMachine.ClearTrackingSession();
}
_stateMachine.ClearTrackingSession();
}

public async Task<RenameTrackingSolutionSet> RenameSymbolAsync(CancellationToken cancellationToken)
Expand All @@ -85,7 +82,7 @@ private async Task<RenameTrackingSolutionSet> RenameSymbolWorkerAsync(Cancellati
return new RenameTrackingSolutionSet(symbol, solutionWithOriginalName, renamedSolution);
}

private bool ApplyChangesToWorkspace(CancellationToken cancellationToken)
private void ApplyChangesToWorkspace(CancellationToken cancellationToken)
{
_stateMachine.ThreadingContext.ThrowIfNotOnUIThread();

Expand Down Expand Up @@ -140,7 +137,7 @@ private bool ApplyChangesToWorkspace(CancellationToken cancellationToken)
EditorFeaturesResources.Rename_Symbol,
NotificationSeverity.Error);

return true;
return;
}

// move all changes to final solution based on the workspace's current solution, since the current solution
Expand All @@ -165,7 +162,6 @@ private bool ApplyChangesToWorkspace(CancellationToken cancellationToken)
trackingSessionId);

RenameTrackingDismisser.DismissRenameTracking(workspace, changedDocuments);
return true;
}

private Solution CreateSolutionWithOriginalName(Document document, CancellationToken cancellationToken)
Expand Down

0 comments on commit f7b944d

Please sign in to comment.