mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[lang-api] Disable code insight actions for compiled files
Fixes IDEA-289020 Action "Insert live template" should not be available inside read-only files GitOrigin-RevId: fda198a7766c5b9a99ec411f522e225ac96f0cdf
This commit is contained in:
committed by
intellij-monorepo-bot
parent
30a7e001ee
commit
e9a60bebf9
@@ -12,6 +12,7 @@ import com.intellij.openapi.editor.EditorModificationUtil;
|
||||
import com.intellij.openapi.editor.actionSystem.DocCommandGroupId;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.psi.PsiCompiledElement;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.util.PsiUtilBase;
|
||||
@@ -51,6 +52,9 @@ public abstract class CodeInsightAction extends AnAction implements UpdateInBack
|
||||
FileModificationService.getInstance().preparePsiElementsForWrite(elementToMakeWritable))) {
|
||||
return;
|
||||
}
|
||||
if (elementToMakeWritable instanceof PsiCompiledElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
CommandProcessor.getInstance().executeCommand(project, () -> {
|
||||
final Runnable action = () -> {
|
||||
|
||||
Reference in New Issue
Block a user