void (@NotNull AnActionEvent event) { Presentation presentation = event.getPresentation(); DataContext dataContext = event.getDataContext(); Editor editor = CommonDataKeys.EDITOR.getData(dataContext); PsiElement originalElement = getOriginalElement(dataContext, editor); PsiElement element = getElement(dataContext, editor, originalElement); final DocumentationProvider provider = DocumentationManager.getProviderFromElement(element); boolean enabled; if (provider instanceof ExternalDocumentationProvider edProvider) { enabled = CompositeDocumentationProvider.hasUrlsFor(provider, element, originalElement) || edProvider.canPromptToConfigureDocumentation(element); } else { final List<String> urls = provider.getUrlFor(element, originalElement); enabled = urls != null && !urls.isEmpty(); } presentation.setEnabled(enabled); if (editor != null) { if (ActionPlaces.isMainMenuOrActionSearch(event.getPlace())) { presentation.setVisible(true); } else { presentation.setVisible(enabled); } } else{ presentation.setVisible(true); } }