don't suggest to expand show usages scope when the target has become invalid (EA-91092 - PIEAE: PsiInvalidElementAccessException.createByNode)

This commit is contained in:
peter
2016-11-03 15:37:33 +01:00
parent 3c4eb67511
commit d4424017dd
@@ -1092,6 +1092,8 @@ public class ShowUsagesAction extends AnAction implements PopupAction {
@NotNull FindUsagesOptions options,
boolean isWarning) {
Runnable runnable = () -> {
if (!handler.getPsiElement().isValid()) return;
JComponent label = createHintComponent(hint, handler, popupPosition, editor, ShowUsagesAction::hideHints, maxUsages, options, isWarning);
if (editor == null || editor.isDisposed() || !editor.getComponent().isShowing()) {
HintManager.getInstance().showHint(label, popupPosition, HintManager.HIDE_BY_ANY_KEY |