boolean (@NotNull XmlAttribute attribute, int offset) { InjectedLanguageManager manager = InjectedLanguageManager.getInstance(attribute.getProject()); PsiElement host = manager.getInjectionHost(attribute); if (host == null) return false; Document doc = PsiDocumentManager.getInstance(attribute.getProject()).getDocument(attribute.getContainingFile()); if (!(doc instanceof DocumentWindow)) return false; return ContainerUtil.exists(manager.getNonEditableFragments((DocumentWindow)doc), range -> { return range.getStartOffset() <= offset && offset <= (range.getEndOffset() + 1); }); }