private static @Nullable PsiWhiteSpace findWhitespaceAtCaret(@NotNull PsiFile file, int offset) {
    return as(file.findElementAt(offset == file.getTextLength() && offset > 0 ? offset - 1 : offset), PsiWhiteSpace.class);
  }
private static @Nullable PsiWhiteSpace findWhitespaceAtCaret(@NotNull PsiFile file, int offset)