private boolean isEnabled(@NotNull CodeStyleSettings settings, @NotNull VirtualFile file) {
    if (!file.isValid() ||
        !file.isWritable() ||
        ScratchUtil.isScratch(file)) {
      return false;
    }
    if (ApplicationManager.getApplication().isUnitTestMode()) {
      return myIsEnabledInTest;
    }
    if (file instanceof LightVirtualFile || myDiscardedOptions.containsKey(file)) {
      return false;
    }
    return hasFormattingModelBuilder(file) && settings.AUTODETECT_INDENTS;
  }
private boolean isEnabled(@NotNull CodeStyleSettings settings, @NotNull VirtualFile file)