提交 cf1e595f 编写于 作者: M Martin Strecker

Revert "Performance: Don't look for implicit interface implementations if the...

Revert "Performance: Don't look for implicit interface implementations if the language doesn't support it."

This reverts commit b90f222e.
上级 b90f222e
......@@ -202,12 +202,9 @@ private int NonParamsParameterCount(IMethodSymbol method)
var methodToUpdate = argumentInsertPositionData.MethodToUpdate;
var argumentToInsert = argumentInsertPositionData.ArgumentToInsert;
var parameters = methodToUpdate.Parameters.Select(p => p.ToDisplayString(SimpleFormat));
var title = GetCodeFixTitle(FeaturesResources.Add_parameter_to_0, methodToUpdate, parameters);
var methodSourceTree = methodToUpdate.Locations.Any() ? methodToUpdate.Locations[0].SourceTree : null;
var semanticFacts = methodSourceTree != null
? context.Document.Project.Solution.GetDocument(methodSourceTree).GetLanguageService<ISemanticFactsService>()
: null;
var hasCascadingDeclarations = HasCascadingDeclarations(methodToUpdate, semanticFacts);
var hasCascadingDeclarations = HasCascadingDeclarations(methodToUpdate);
CodeAction codeAction = new MyCodeAction(title,
c => FixAsync(context.Document, methodToUpdate, argumentToInsert, arguments, fixAllReferences: false, c));
if (hasCascadingDeclarations)
......@@ -232,7 +229,7 @@ private int NonParamsParameterCount(IMethodSymbol method)
/// Checks if there are indications that there might be more than one declarations that need to be fixed.
/// The check does not look-up if there are other declarations (this is done later in the CodeAction).
/// </summary>
private bool HasCascadingDeclarations(IMethodSymbol method, ISemanticFactsService semanticFacts)
private bool HasCascadingDeclarations(IMethodSymbol method)
{
// Don't cascade constructors
if (method.IsConstructor())
......@@ -253,11 +250,6 @@ private bool HasCascadingDeclarations(IMethodSymbol method, ISemanticFactsServic
return true;
}
if (semanticFacts?.SupportsImplicitInterfaceImplementation == false)
{
return false;
}
// For implicit interface implementations lets check if the characteristic of the method
// allows it to implicit implement an interface member.
if (method.DeclaredAccessibility != Accessibility.Public)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册