Result (@NotNull PsiFile file, @NotNull Editor editor, @NotNull Ref<Integer> caretOffset, @NotNull Ref<Integer> caretAdvance, @NotNull DataContext dataContext, EditorActionHandler originalHandler) { if (!(file instanceof PsiJavaFile) || !file.isValid()) return Result.Continue; final InjectedLanguageManager injectedLanguageManager = InjectedLanguageManager.getInstance(file.getProject()); final PsiSnippetDocTag host = ObjectUtils.tryCast(injectedLanguageManager.getInjectionHost(file), PsiSnippetDocTag.class); return host == null ? Result.Continue : Result.Default; }