TextRange (PsiElement element, TextRange range) { if (!myPyCodeStyleSettings.SPACE_AFTER_NUMBER_SIGN) { return range; } myRange = range; final PsiDocumentManager manager = PsiDocumentManager.getInstance(myProject); final Document document = manager.getDocument(element.getContainingFile()); if (document != null) { // collect all comments element.accept(this); for (Couple<PsiComment> pair : myCommentReplacements) { pair.getFirst().replace(pair.getSecond()); } } return TextRange.create(range.getStartOffset(), range.getEndOffset() + myDelta); }