public static void ComputeRefactoring(RefactoringContext context, ParameterSyntax parameter)
        {
            if (!parameter.Identifier.Span.Contains(context.Span))
            {
                return;
            }

            if (!IsValid(parameter))
            {
                return;
            }

            if (context.IsRefactoringEnabled(RefactoringIdentifiers.IntroduceAndInitializeProperty))
            {
                var propertyInfo = new IntroduceAndInitializePropertyInfo(parameter, context.SupportsCSharp6);
                var refactoring  = new IntroduceAndInitializePropertyRefactoring(propertyInfo);
                refactoring.RegisterRefactoring(context);
            }

            if (context.IsRefactoringEnabled(RefactoringIdentifiers.IntroduceAndInitializeField))
            {
                var fieldInfo   = new IntroduceAndInitializeFieldInfo(parameter, context.Settings.PrefixFieldIdentifierWithUnderscore);
                var refactoring = new IntroduceAndInitializeFieldRefactoring(fieldInfo);
                refactoring.RegisterRefactoring(context);
            }
        }
        public static void ComputeRefactoring(RefactoringContext context, ParameterListSyntax parameterList)
        {
            if (!SeparatedSyntaxListSelection <ParameterSyntax> .TryCreate(parameterList.Parameters, context.Span, out SeparatedSyntaxListSelection <ParameterSyntax> selection))
            {
                return;
            }

            ImmutableArray <ParameterSyntax> parameters = selection
                                                          .Where(IsValid)
                                                          .ToImmutableArray();

            if (!parameters.Any())
            {
                return;
            }

            if (context.IsRefactoringEnabled(RefactoringIdentifiers.IntroduceAndInitializeProperty))
            {
                IEnumerable <IntroduceAndInitializePropertyInfo> propertyInfos = parameters
                                                                                 .Select(parameter => new IntroduceAndInitializePropertyInfo(parameter, context.SupportsCSharp6));

                var refactoring = new IntroduceAndInitializePropertyRefactoring(propertyInfos);
                refactoring.RegisterRefactoring(context);
            }

            if (context.IsRefactoringEnabled(RefactoringIdentifiers.IntroduceAndInitializeField))
            {
                IEnumerable <IntroduceAndInitializeFieldInfo> fieldInfos = parameters
                                                                           .Select(parameter => new IntroduceAndInitializeFieldInfo(parameter, context.Settings.PrefixFieldIdentifierWithUnderscore));

                var refactoring = new IntroduceAndInitializeFieldRefactoring(fieldInfos);
                refactoring.RegisterRefactoring(context);
            }
        }
        public static void ComputeRefactoring(RefactoringContext context, ParameterListSyntax parameterList)
        {
            ImmutableArray <ParameterSyntax> parameters = GetParameters(parameterList, context.Span);

            if (parameters.Any())
            {
                if (context.IsRefactoringEnabled(RefactoringIdentifiers.IntroduceAndInitializeProperty))
                {
                    IEnumerable <IntroduceAndInitializePropertyInfo> propertyInfos = parameters
                                                                                     .Select(parameter => new IntroduceAndInitializePropertyInfo(parameter, context.SupportsCSharp6));

                    var refactoring = new IntroduceAndInitializePropertyRefactoring(propertyInfos);
                    refactoring.RegisterRefactoring(context);
                }

                if (context.IsRefactoringEnabled(RefactoringIdentifiers.IntroduceAndInitializeField))
                {
                    IEnumerable <IntroduceAndInitializeFieldInfo> fieldInfos = parameters
                                                                               .Select(parameter => new IntroduceAndInitializeFieldInfo(parameter, context.Settings.PrefixFieldIdentifierWithUnderscore));

                    var refactoring = new IntroduceAndInitializeFieldRefactoring(fieldInfos);
                    refactoring.RegisterRefactoring(context);
                }
            }
        }