private static void ReportForUnimplemented(CodeRefactoringContext context, IMethodSymbol constructor, SemanticModel semanticModel, ArgumentListSyntax node, TypeInfo typeSymbol) { var unimplemntedParameters = constructor.Parameters.Skip(node.Arguments.Count); var typesymbols = semanticModel.GetTypeSymbols(node, typeSymbol); var symbols = typesymbols.Where(x => ImplementsSomethingFor(x.TypeSymbol, unimplemntedParameters)) .Distinct(); foreach(var symbol in symbols) context.RegisterRefactoring( new FixConstructor(constructor, node, symbol.Name, semanticModel, context.Document)); }
private static void ReportForUnimplemented(CodeRefactoringContext context, IEnumerable<IMethodSymbol> unimplemntedProperties, SemanticModel semanticModel, InitializerExpressionSyntax node, TypeInfo typeSymbol) { var typesymbols = semanticModel.GetTypeSymbols(node, typeSymbol); var symbols = typesymbols.Where(x => ImplementsSomethingFor(x.TypeSymbol, unimplemntedProperties)) .Distinct(); foreach (var symbol in symbols) context.RegisterRefactoring( new FillInitializerFrom(node, symbol.Name, semanticModel, context.Document)); context.RegisterRefactoring( new FillInitializer(node, semanticModel, context.Document)); }