private static @Nullable PsiSnippetDocTag getHost(@NotNull PsiFile file, @NotNull Editor editor) {
    if (!(file instanceof PsiJavaFile) || !file.isValid()) return null;

    if (!(editor instanceof EditorWindow)) {
      return null;
    }

    final SmartPsiElementPointer<?> data = file.getUserData(FileContextUtil.INJECTED_IN_ELEMENT);
    if (data == null) return null;

    final PsiSnippetDocTagImpl host = ObjectUtils.tryCast(data.getElement(), PsiSnippetDocTagImpl.class);
    if (host == null) return null;
    return host;
  }
private static @Nullable PsiSnippetDocTag getHost(@NotNull PsiFile file, @NotNull Editor editor)