mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't try to modify decompiled code (EA-35877)
This commit is contained in:
+6
@@ -45,6 +45,7 @@ import com.intellij.openapi.options.ShowSettingsUtil;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.PsiCompiledElement;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -69,6 +70,11 @@ public class SurroundWithHandler implements CodeInsightActionHandler {
|
||||
}
|
||||
|
||||
public static void invoke(final Project project, final Editor editor, PsiFile file, Surrounder surrounder) {
|
||||
if (file instanceof PsiCompiledElement) {
|
||||
HintManager.getInstance().showErrorHint(editor, "Can't modify decompiled code");
|
||||
return;
|
||||
}
|
||||
|
||||
List<AnAction> applicable = buildSurroundActions(project, editor, file, surrounder);
|
||||
if (applicable != null) {
|
||||
showPopup(editor, applicable);
|
||||
|
||||
Reference in New Issue
Block a user