mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-228916 IntentionAction.isAvailable() shouldn't be called in EDT on F2 / Shift+F2
execute 'calcTooltipAction' in read action (fixes IDEA-231613) GitOrigin-RevId: 318f92a5299919965bee0832d11bca525384a06f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
05491e82cc
commit
0ca3b164b0
+13
-4
@@ -479,10 +479,19 @@ public final class EditorMouseHoverPopupManager implements Disposable {
|
||||
@Nullable
|
||||
private Info calcInfo(@NotNull Editor editor) {
|
||||
HighlightInfo info = getHighlightInfo();
|
||||
if (info != null && (info.getDescription() == null || info.getToolTip() == null)) {
|
||||
info = null;
|
||||
HighlightInfo infoToUse = null;
|
||||
TooltipAction tooltipAction = null;
|
||||
if (info != null && info.getDescription() != null && info.getToolTip() != null) {
|
||||
infoToUse = info;
|
||||
try {
|
||||
tooltipAction = ReadAction.nonBlocking(() -> TooltipActionProvider.calcTooltipAction(info, editor)).executeSynchronously();
|
||||
}
|
||||
catch (IndexNotReadyException ignored) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOG.warn(e);
|
||||
}
|
||||
}
|
||||
TooltipAction tooltipAction = info == null ? null : TooltipActionProvider.calcTooltipAction(info, editor);
|
||||
|
||||
String quickDocMessage = null;
|
||||
PsiElement targetElement = null;
|
||||
@@ -517,7 +526,7 @@ public final class EditorMouseHoverPopupManager implements Disposable {
|
||||
LOG.warn(e);
|
||||
}
|
||||
}
|
||||
return info == null && quickDocMessage == null ? null : new Info(info, tooltipAction, quickDocMessage, targetElement);
|
||||
return infoToUse == null && quickDocMessage == null ? null : new Info(infoToUse, tooltipAction, quickDocMessage, targetElement);
|
||||
}
|
||||
|
||||
private enum Relation {
|
||||
|
||||
Reference in New Issue
Block a user