public override void Fix(IInspectionResult result, IRewriteSession rewriteSession) { var duplicateAnnotations = result.Target.Annotations .Where(annotation => annotation.AnnotationType == result.Properties.AnnotationType) .OrderBy(annotation => annotation.Context.Start.StartIndex) .Skip(1) .ToList(); _annotationUpdater.RemoveAnnotations(rewriteSession, duplicateAnnotations); }
public override void Fix(IInspectionResult result, IRewriteSession rewriteSession) { var duplicateAnnotations = result.Target.Annotations .Where(pta => pta.Annotation == result.Properties.Annotation) .OrderBy(annotation => annotation.AnnotatedLine) .Skip(1) .ToList(); _annotationUpdater.RemoveAnnotations(rewriteSession, duplicateAnnotations); }
public override void Fix(IInspectionResult result, IRewriteSession rewriteSession) { if (!(result is IWithInspectionResultProperties <IAnnotation> resultProperties)) { return; } var resultAnnotation = resultProperties.Properties; var duplicateAnnotations = result.Target.Annotations .Where(pta => pta.Annotation == resultAnnotation) .OrderBy(annotation => annotation.AnnotatedLine) .Skip(1) .ToList(); _annotationUpdater.RemoveAnnotations(rewriteSession, duplicateAnnotations); }