void (@NotNull Project project, @NotNull CodeStyleSettings tempSettings, @NotNull Runnable runnable) { final CodeStyleSettingsManager settingsManager = CodeStyleSettingsManager.getInstance(project); CodeStyleSettings tempSettingsBefore = settingsManager.getTemporarySettings(); try { settingsManager.setTemporarySettings(tempSettings); runnable.run(); } finally { if (tempSettingsBefore != null) { settingsManager.setTemporarySettings(tempSettingsBefore); } else { settingsManager.dropTemporarySettings(); } } }