void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiCodeBlock block = ObjectUtils.tryCast(descriptor.getStartElement(), PsiCodeBlock.class); TextRange range = getRange(block); if (range == null) return; new MethodExtractor().doExtract(block.getContainingFile(), range.shiftRight(block.getTextRange().getStartOffset())); }