public static boolean hasNonCodeUsages(@NotNull PsiElement element,
                                         String newName,
                                         @NotNull SearchScope searchScope,
                                         boolean searchInStringsAndComments,
                                         boolean searchForTextOccurrences) {
    RenamePsiElementProcessorBase elementProcessor = RenamePsiElementProcessorBase.forPsiElement(element);
    return !processUsages(element, elementProcessor, newName, searchScope, false, searchInStringsAndComments, searchForTextOccurrences, info -> false
    );
  }
public static boolean hasNonCodeUsages(@NotNull PsiElement element,
                                         String newName,
                                         @NotNull SearchScope searchScope,
                                         boolean searchInStringsAndComments,
                                         boolean searchForTextOccurrences)