提交 4c220422 编写于 作者: M Mihaly Marton

Changed SuppressionFixAllProvider to bail out in the case of a local...

Changed SuppressionFixAllProvider to bail out in the case of a local suppression (support to be added later).
上级 be876cbe
......@@ -18,6 +18,12 @@ private SuppressionFixAllProvider()
public async override Task<CodeAction> GetFixAsync(FixAllContext fixAllContext)
{
// currently there's no FixAll support for local suppression, just bail out
if (NestedSuppressionCodeAction.IsEquivalenceKeyForLocalSuppression(fixAllContext.CodeActionEquivalenceKey))
{
return null;
}
var batchFixer = WellKnownFixAllProviders.BatchFixer;
var suppressionFixer = (AbstractSuppressionCodeFixProvider)((WrapperCodeFixProvider)fixAllContext.CodeFixProvider).SuppressionFixProvider;
var isGlobalSuppression = NestedSuppressionCodeAction.IsEquivalenceKeyForGlobalSuppression(fixAllContext.CodeActionEquivalenceKey);
......
......@@ -26,5 +26,7 @@ protected NestedSuppressionCodeAction(string title)
equivalenceKey.StartsWith(FeaturesResources.in_Source);
public static bool IsEquivalenceKeyForRemoveSuppression(string equivalenceKey) =>
equivalenceKey.StartsWith(FeaturesResources.Remove_Suppression);
public static bool IsEquivalenceKeyForLocalSuppression(string equivalenceKey) =>
equivalenceKey.StartsWith(FeaturesResources.in_Source_attribute);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册