public static CodeStyleSettings getSettings(@NotNull PsiFile file) {
    final Project project = file.getProject();

    CodeStyleSettings localOrTempSettings = getLocalOrTemporarySettings(project);
    if (localOrTempSettings != null) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("localOrTemp settings for " + file.getName());
      }
      return localOrTempSettings;
    }
    PsiFile topLevel = InjectedLanguageManager.getInstance(project).getTopLevelFile(file);
    PsiFile settingsFile = getSettingsPsi(topLevel != null ? topLevel : file);
    if (settingsFile == null) {
      return getSettings(project);
    }
    VirtualFile virtualFile = settingsFile.getVirtualFile();
    if (virtualFile == null) {
      return getSettings(project);
    }
    return getCachedOrProjectSettings(project, virtualFile);
  }
public static CodeStyleSettings getSettings(@NotNull PsiFile file)