public static boolean isSpellCheckingDisabled(@NotNull PsiFile file) {
    Function<? super InspectionProfile, ? extends InspectionProfileWrapper>
      strategy = InspectionProfileWrapper.getCustomInspectionProfileWrapper(file);
    return strategy instanceof MyInspectionProfileStrategy && !((MyInspectionProfileStrategy)strategy).myUseSpellCheck;
  }
public static boolean isSpellCheckingDisabled(@NotNull PsiFile file)