@Override
  public boolean isAvailable(final @NotNull Project project, final Editor editor, final PsiFile file) {
    if (file instanceof XmlFile) {
      if (editor != null) {
        final int offset = editor.getCaretModel().getOffset();
        final PsiElement psiElement = file.findElementAt(offset);
        if (psiElement != null) {
          final PsiElement parent = psiElement.getParent();
          if (parent instanceof XmlText && parent.getText().trim().length() > 0) {
            final PsiElement grandParent = parent.getParent();
            if (grandParent != null && !isInsideUnsplittableElement(grandParent)) {
              return InjectedLanguageManager.getInstance(project).findInjectedElementAt(file, offset) == null;
            }
          }
        }
      }
    }

    return false;
  }
@Override
  public boolean isAvailable(final @NotNull Project project, final Editor editor, final PsiFile file)