public void runWithLocalSettings(@NotNull CodeStyleSettings baseSettings,
                                   @NotNull Consumer<? super @NotNull CodeStyleSettings> localSettingsConsumer) {
    CodeStyleSettings tempSettingsBefore = myLocalSettings.get();
    try {
      CodeStyleSettings tempSettings = new CodeStyleSettings(true, false);
      tempSettings.copyFrom(baseSettings);
      myLocalSettings.set(tempSettings);
      localSettingsConsumer.accept(tempSettings);
    }
    finally {
      myLocalSettings.set(tempSettingsBefore);
    }
  }
public void runWithLocalSettings(@NotNull CodeStyleSettings baseSettings,
                                   @NotNull Consumer<? super @NotNull CodeStyleSettings> localSettingsConsumer)