Search in sources :

Example 1 with CodeStyleSettingsCodeFragmentFilter

use of com.intellij.psi.codeStyle.CodeStyleSettingsCodeFragmentFilter in project intellij-community by JetBrains.

the class ConfigureCodeStyleOnSelectedFragment method calculateAffectingSettings.

private static CodeStyleSettingsToShow calculateAffectingSettings(@NotNull Editor editor, @NotNull PsiFile file) {
    SelectionModel model = editor.getSelectionModel();
    int start = model.getSelectionStart();
    int end = model.getSelectionEnd();
    CodeStyleSettingsCodeFragmentFilter settingsProvider = new CodeStyleSettingsCodeFragmentFilter(file, new TextRange(start, end));
    return CodeFragmentCodeStyleSettingsPanel.calcSettingNamesToShow(settingsProvider);
}
Also used : CodeStyleSettingsCodeFragmentFilter(com.intellij.psi.codeStyle.CodeStyleSettingsCodeFragmentFilter) SelectionModel(com.intellij.openapi.editor.SelectionModel) TextRange(com.intellij.openapi.util.TextRange)

Aggregations

SelectionModel (com.intellij.openapi.editor.SelectionModel)1 TextRange (com.intellij.openapi.util.TextRange)1 CodeStyleSettingsCodeFragmentFilter (com.intellij.psi.codeStyle.CodeStyleSettingsCodeFragmentFilter)1