From 4e4f13ae829370ba5215abed839aca72ecbfe585 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 2 May 2016 20:39:54 +0200 Subject: [PATCH] use async commit in DocumentationManager --- .../documentation/DocumentationManager.java | 52 ++++++++----------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java index 76ecbb90f083..6816e27b662b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java @@ -757,37 +757,31 @@ public class DocumentationManager extends DockablePopupManager { + if (!element.isValid()) { + LOG.debug("Element for which documentation was requested is not valid"); callback.setDone(); + return; } + + if (documentationText == null) { + component.setText(CodeInsightBundle.message("no.documentation.found"), element, true, clearHistory); + } + else if (documentationText.isEmpty()) { + component.setText(component.getText(), element, true, clearHistory); + } + else { + component.setData(element, documentationText, clearHistory, provider.getEffectiveExternalUrl(), provider.getRef()); + } + + final AbstractPopup jbPopup = (AbstractPopup)getDocInfoHint(); + if(jbPopup==null){ + callback.setDone(); + return; + } + jbPopup.setDimensionServiceKey(JAVADOC_LOCATION_AND_SIZE); + jbPopup.setCaption(getTitle(element, false)); + callback.setDone(); }); } }, 10);