提交 ee036c9c 编写于 作者: C CyrusNajmabadi

Simplify code.

上级 6e92e2b4
......@@ -43,17 +43,21 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(
new FixNameCodeAction(
string.Format(FeaturesResources.Fix_Name_Violation_colon_0, fixedName),
async c => await Renamer.RenameSymbolAsync(
solution,
symbol,
fixedName,
await document.GetOptionsAsync(c).ConfigureAwait(false),
c).ConfigureAwait(false),
c => FixAsync(document, symbol, fixedName, c),
nameof(NamingStyleCodeFixProvider)),
diagnostic);
}
}
private static async Task<Solution> FixAsync(
Document document, ISymbol symbol, string fixedName, CancellationToken cancellationToken)
{
return await Renamer.RenameSymbolAsync(
document.Project.Solution, symbol, fixedName,
await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false),
cancellationToken).ConfigureAwait(false);
}
private class FixNameCodeAction : CodeAction.SolutionChangeAction
{
public FixNameCodeAction(string title, Func<CancellationToken, Task<Solution>> createChangedSolution, string equivalenceKey)
......
......@@ -52,11 +52,5 @@ public MutableNamingStyle(NamingStyle namingStyle)
internal MutableNamingStyle Clone()
=> new MutableNamingStyle(NamingStyle);
internal XElement CreateXElement()
=> NamingStyle.CreateXElement();
internal static MutableNamingStyle FromXElement(XElement namingStyleElement)
=> new MutableNamingStyle(NamingStyle.FromXElement(namingStyleElement));
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册