Navigatable (@NotNull InspectionTreeNode node) { if (node.isExcluded()) { return null; } if (node instanceof RefElementNode refNode) { if (hasDescriptorUnder(refNode)) return null; final RefEntity element = refNode.getElement(); if (element == null || !element.isValid()) return null; if (element instanceof RefElement) { return getOpenFileDescriptor((RefElement)element); } } else if (node instanceof ProblemDescriptionNode problemNode) { boolean isValid = problemNode.isValid() && (!problemNode.isQuickFixAppliedFromView() || problemNode.calculateIsValid()); return isValid ? navigate(problemNode.getDescriptor()) : InspectionResultsViewUtil.getNavigatableForInvalidNode(problemNode); } return null; }