@Override
      public void visitFile(@NotNull PsiFile file) {
        final TextRange range = restrictRange.intersection(file.getTextRange());
        if (range == null || range.isEmpty()) return;

        int line = document.getLineNumber(range.getStartOffset());
        while (true) {
          final int lineStart = document.getLineStartOffset(line);
          if (lineStart > range.getEndOffset()) {
            break;
          }
          final int lineEnd = document.getLineEndOffset(line);
          int count = 0;
          for (int i = lineStart; i < lineEnd; i++) {
            count += (text.charAt(i) == '\t') ? tabSize : 1;
            if (count > codeStyleRightMargin) {
              String message =
                LangBundle.message("inspection.message.line.longer.than.allowed.by.code.style.columns", codeStyleRightMargin);
              final TextRange problemRange = new TextRange(i, lineEnd);
              final PsiElement element = findElementInRange(file, problemRange);
              if (!ignoreFor(element)) {
                holder.registerProblem(element, problemRange.shiftLeft(element.getTextRange().getStartOffset()), message);
              }
              break;
            }
          }
          line++;
          if (line >= lineCount) break;
        }
      }
@Override
      public void visitFile(@NotNull PsiFile file)