public static CodeStyleSettings getSettings(@NotNull Editor editor) {
    Project project = editor.getProject();
    VirtualFile file = editor.getVirtualFile();
    if (file != null && project != null) {
      return getSettings(project, file);
    }
    return getDefaultSettings();
  }
public static CodeStyleSettings getSettings(@NotNull Editor editor)