Skip to content

Commit

Permalink
Change the ApplyChangesOperation
Browse files Browse the repository at this point in the history
  • Loading branch information
Cosifne committed Apr 26, 2023
1 parent 0c21c57 commit 6a8d498
Showing 1 changed file with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,6 @@ public LanguageServerSymbolRenamedCodeActionOperationFactoryWorkspaceService()
}

public CodeActionOperation CreateSymbolRenamedOperation(ISymbol symbol, string newName, Solution startingSolution, Solution updatedSolution)
=> new RenameCodeActionOperation(
title: string.Format(WorkspacesResources.Rename_0_to_1, symbol.Name, newName),
updateSolution: updatedSolution);

private class RenameCodeActionOperation : CodeActionOperation
{
private readonly string _title;
private readonly Solution _updateSolution;

public RenameCodeActionOperation(string title, Solution updateSolution)
{
_title = title;
_updateSolution = updateSolution;
}

public override void Apply(Workspace workspace, CancellationToken cancellationToken = default)
=> workspace.TryApplyChanges(_updateSolution);

public override string? Title => _title;
}
=> new ApplyChangesOperation(updatedSolution);
}
}

0 comments on commit 6a8d498

Please sign in to comment.