Пример #1
0
        public RemoveReadonlyFromSerializedFieldQuickFix(RedundantSerializeFieldAttributeWarning highlighting)
        {
            myAttribute = highlighting.Attribute;
            var attributeSectionList = AttributeSectionListNavigator.GetByAttribute(myAttribute);

            myMultipleFieldDeclaration = MultipleFieldDeclarationNavigator.GetByAttributes(attributeSectionList);
            myFieldDeclarations        = FieldDeclarationNavigator.GetByAttribute(myAttribute);
        }
Пример #2
0
        protected override Action <ITextControl> ExecutePsiTransaction(ISolution solution, IProgressIndicator progress)
        {
            var attributeSectionList     = AttributeSectionListNavigator.GetByAttribute(myAttribute);
            var multipleFieldDeclaration = MultipleFieldDeclarationNavigator.GetByAttributes(attributeSectionList);

            if (multipleFieldDeclaration != null)
            {
                SplitDeclarationsListAction.Execute(multipleFieldDeclaration);
            }
            return(null);
        }
        private void RemoveFromTextualOccurrences(IRenameRefactoring executer, IFieldDeclaration fieldDeclaration)
        {
            if (!(executer.Workflow is RenameWorkflow workflow))
            {
                return;
            }

            var attributes = fieldDeclaration.Attributes;

            if (attributes.Count == 0)
            {
                return;
            }

            var attribute            = attributes[0];
            var attributeSectionList = AttributeSectionListNavigator.GetByAttribute(attribute);

            if (attributeSectionList == null)
            {
                return;
            }

            var attributesRange = attributeSectionList.GetDocumentRange();

            foreach (var occurrence in workflow.DataModel.ActualOccurrences ?? EmptyList <TextOccurrenceRenameMarker> .InstanceList)
            {
                if (!occurrence.Included)
                {
                    continue;
                }


                var occurrenceRange = occurrence.Marker.DocumentRange;
                if (attributesRange.Contains(occurrenceRange))
                {
                    occurrence.Included = false;
                    break;
                }
            }
        }