use of com.intellij.psi.codeStyle.CustomCodeStyleSettings in project intellij-community by JetBrains.
the class Utils method getLanguageSettings.
@Nullable
public static CustomCodeStyleSettings getLanguageSettings(@NotNull CodeStyleSettings settings, @NotNull Language language) {
for (CodeStyleSettingsProvider provider : CodeStyleSettingsProvider.EXTENSION_POINT_NAME.getExtensions()) {
if (language.equals(provider.getLanguage())) {
CustomCodeStyleSettings modelSettings = provider.createCustomSettings(settings);
if (modelSettings == null)
continue;
CustomCodeStyleSettings customSettings = settings.getCustomSettings(modelSettings.getClass());
if (customSettings != null) {
return customSettings;
}
}
}
logError("Failed to load CustomCodeStyleSettings for " + language);
return null;
}
Aggregations