boolean (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { PsiLanguageInjectionHost host = findInjectionHost(editor, file); if (host == null) return false; if (!InjectionUtils.isInjectLanguageActionEnabled(host)) return false; List<Pair<PsiElement, TextRange>> injectedPsi = InjectedLanguageManager.getInstance(project).getInjectedPsiFiles(host); if (injectedPsi == null || injectedPsi.isEmpty()) { return !InjectedReferencesContributor.isInjected(file.findReferenceAt(editor.getCaretModel().getOffset())); } return false; }