Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Cosifne committed May 4, 2023
1 parent 05a141f commit 9b6958b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Microsoft.CodeAnalysis.Rename;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Roslyn.Utilities;
using Microsoft.CodeAnalysis.Shared.Collections;

#if !CODE_STYLE // https://github.com/dotnet/roslyn/issues/42218 removing dependency on WorkspaceServices.
using Microsoft.CodeAnalysis.CodeActions.WorkspaceServices;
Expand Down Expand Up @@ -164,7 +165,7 @@ protected override async Task<IEnumerable<CodeActionOperation>> ComputeOperation
return SpecializedCollections.SingletonEnumerable(codeAction);
#else

using var _ = PooledObjects.ArrayBuilder<CodeActionOperation>.GetInstance(out var operations);
using var operations = TemporaryArray<CodeActionOperation>.Empty;

operations.Add(codeAction);
var factory = _startingSolution.Services.GetService<ISymbolRenamedCodeActionOperationFactoryWorkspaceService>();
Expand All @@ -173,7 +174,7 @@ protected override async Task<IEnumerable<CodeActionOperation>> ComputeOperation
operations.Add(factory.CreateSymbolRenamedOperation(_symbol, _newName, _startingSolution, newSolution));
}

return operations.ToImmutable();
return operations.ToImmutableAndClear();
#endif
}

Expand Down

0 comments on commit 9b6958b

Please sign in to comment.