boolean (EditorWindow editor, TextRange range, Project project) { PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); if (file == null) return true; List<TextRange> editables = InjectedLanguageManager.getInstance(project).intersectWithAllEditableFragments(file, range); return editables.size() == 1 && range.equals(editables.get(0)); }