提交 35a88f97 编写于 作者: C Cyrus Najmabadi

simplify

上级 9cfc839d
......@@ -80,7 +80,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
.Distinct()
.ToImmutableArray();
var scopes = ArrayBuilder<CodeAction>.GetInstance();
using var _ = ArrayBuilder<CodeAction>.GetInstance(out var scopes);
scopes.Add(CreateAction(context, Scope.ContainingMember));
// If we captured any Method type-parameters, we can only replace the tuple types we
......@@ -90,9 +90,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
{
var containingType = tupleExprOrTypeNode.GetAncestor<TTypeBlockSyntax>();
if (containingType != null)
{
scopes.Add(CreateAction(context, Scope.ContainingType));
}
// If we captured any Type type-parameters, we can only replace the tuple
// types we find in the containing type. No other tuple types in other
......@@ -116,7 +114,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
context.RegisterRefactoring(
new CodeAction.CodeActionWithNestedActions(
FeaturesResources.Convert_to_struct,
scopes.ToImmutableAndFree(),
scopes.ToImmutable(),
isInlinable: false),
tupleExprOrTypeNode.Span);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册