private static boolean isInsideRanges(@NotNull PsiElement element, @NotNull Set<? extends TextRange> ranges) {
    for (TextRange range : ranges) {
      TextRange elementRange = element.getTextRange();
      if (range.contains(elementRange.getStartOffset()) || range.contains(elementRange.getEndOffset())) {
        return true;
      }
    }
    return false;
  }
private static boolean isInsideRanges(@NotNull PsiElement element, @NotNull Set<? extends TextRange> ranges)