Search in sources :

Example 1 with CustomCodeStyleSettings

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;
}
Also used : CodeStyleSettingsProvider(com.intellij.psi.codeStyle.CodeStyleSettingsProvider) CustomCodeStyleSettings(com.intellij.psi.codeStyle.CustomCodeStyleSettings) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

CodeStyleSettingsProvider (com.intellij.psi.codeStyle.CodeStyleSettingsProvider)1 CustomCodeStyleSettings (com.intellij.psi.codeStyle.CustomCodeStyleSettings)1 Nullable (org.jetbrains.annotations.Nullable)1