Disable configure code style on selected fragment intention for read-only files

This commit is contained in:
Yaroslav Lepenkin
2015-05-25 18:07:15 +03:00
parent 007fd699c5
commit bc94e2714b
@@ -63,7 +63,7 @@ public class ConfigureCodeStyleOnSelectedFragment implements IntentionAction {
@Override
public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
Language language = file.getLanguage();
return editor.getSelectionModel().hasSelection() && LanguageCodeStyleSettingsProvider.forLanguage(language) != null;
return editor.getSelectionModel().hasSelection() && LanguageCodeStyleSettingsProvider.forLanguage(language) != null && file.isWritable();
}
@Override